All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel/crash_core.c : Remove redundant checks for ck_cmdline is NULL
@ 2022-04-25 15:38 ` lizhe
  0 siblings, 0 replies; 10+ messages in thread
From: lizhe @ 2022-04-25 15:38 UTC (permalink / raw)
  To: bhe, vgoyal, dyoung, prudo, sensor1010; +Cc: kexec, linux-kernel

 When ck_cmdline is NULL, the only caller of get_last_crashkernel()
 has already done non-NULL check(see __parse_crashkernel()),
 so it doesn't make any sense to make a check here

Signed-off-by: lizhe <sensor1010@163.com>
---
 kernel/crash_core.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/crash_core.c b/kernel/crash_core.c
index 256cf6db573c..c232f01a2c54 100644
--- a/kernel/crash_core.c
+++ b/kernel/crash_core.c
@@ -222,9 +222,6 @@ static __init char *get_last_crashkernel(char *cmdline,
 		p = strstr(p+1, name);
 	}
 
-	if (!ck_cmdline)
-		return NULL;
-
 	return ck_cmdline;
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH] kernel/crash_core.c : Remove redundant checks for ck_cmdline is NULL
@ 2022-05-04 12:36 ` lizhe
  0 siblings, 0 replies; 10+ messages in thread
From: lizhe @ 2022-05-04 12:36 UTC (permalink / raw)
  To: bhe, vgoyal, dyoung, prudo; +Cc: kexec, linux-kernel, lizhe

When ck_cmdline is NULL. The last three lines of
this function(get_last_crashkernel()) are equivalent to :
	if (!NULL)
		return NULL;

	return NULL;
This is obviously a redundant check

Signed-off-by: lizhe <sensor1010@163.com>
---
 kernel/crash_core.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/crash_core.c b/kernel/crash_core.c
index 256cf6db573c..c232f01a2c54 100644
--- a/kernel/crash_core.c
+++ b/kernel/crash_core.c
@@ -222,9 +222,6 @@ static __init char *get_last_crashkernel(char *cmdline,
 		p = strstr(p+1, name);
 	}
 
-	if (!ck_cmdline)
-		return NULL;
-
 	return ck_cmdline;
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-05-05 23:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 15:38 [PATCH] kernel/crash_core.c : Remove redundant checks for ck_cmdline is NULL lizhe
2022-04-25 15:38 ` lizhe
2022-04-26  8:39 ` Philipp Rudo
2022-04-26  8:39   ` Philipp Rudo
     [not found]   ` <6a0fa9cc.19d4.1808440ca50.Coremail.sensor1010@163.com>
2022-05-03 16:43     ` Philipp Rudo
2022-05-03 16:43       ` Philipp Rudo
2022-05-04 12:36 lizhe
2022-05-04 12:36 ` lizhe
2022-05-05 23:19 ` Baoquan He
2022-05-05 23:19   ` Baoquan He

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.