[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231020083743.11412-1-zhoujie@nfschina.com>
Date: Fri, 20 Oct 2023 16:37:43 +0800
From: ZhouJie <zhoujie@...china.com>
To: rafael@...nel.org, pavel@....cz, len.brown@...el.com
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
ZhouJie <zhoujie@...china.com>
Subject: [PATCH] power: main: Remove unnecessary ‘NULL’ initialization from last_failed_step_show()
Declaring char *last_failed_step; is reasonable because you can later
assign the function's return value to last_failed_step without
explicitly assigning an initial value.
Signed-off-by: ZhouJie <zhoujie@...china.com>
---
kernel/power/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/power/main.c b/kernel/power/main.c
index f6425ae3e8b05..24c675f6ab862 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -410,7 +410,7 @@ static ssize_t last_failed_step_show(struct kobject *kobj,
{
int index;
enum suspend_stat_step step;
- char *last_failed_step = NULL;
+ char *last_failed_step;
index = suspend_stats.last_failed_step + REC_FAILED_NUM - 1;
index %= REC_FAILED_NUM;
--
2.18.2
Powered by blists - more mailing lists