All of lore.kernel.org
 help / color / mirror / Atom feed
From: lizhe <sensor1010@163.com>
To: kexec@lists.infradead.org
Subject: [PATCH] kernel/crash_core.c : Remove redundant checks for ck_cmdline is NULL
Date: Wed,  4 May 2022 05:36:23 -0700	[thread overview]
Message-ID: <20220504123623.36852-1-sensor1010@163.com> (raw)

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



WARNING: multiple messages have this Message-ID (diff)
From: lizhe <sensor1010@163.com>
To: bhe@redhat.com, vgoyal@redhat.com, dyoung@redhat.com, prudo@redhat.com
Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	lizhe <sensor1010@163.com>
Subject: [PATCH] kernel/crash_core.c : Remove redundant checks for ck_cmdline is NULL
Date: Wed,  4 May 2022 05:36:23 -0700	[thread overview]
Message-ID: <20220504123623.36852-1-sensor1010@163.com> (raw)

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


             reply	other threads:[~2022-05-04 12:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 12:36 lizhe [this message]
2022-05-04 12:36 ` [PATCH] kernel/crash_core.c : Remove redundant checks for ck_cmdline is NULL lizhe
2022-05-05 23:19 ` Baoquan He
2022-05-05 23:19   ` Baoquan He
  -- strict thread matches above, loose matches on Subject: below --
2022-04-25 15:38 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220504123623.36852-1-sensor1010@163.com \
    --to=sensor1010@163.com \
    --cc=kexec@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.