[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d00bf2e8-3022-64a1-0458-56497179d5aa@huaweicloud.com>
Date: Thu, 31 Aug 2023 09:25:59 +0800
From: "Leizhen (ThunderTown)" <thunder.leizhen@...weicloud.com>
To: Baoquan He <bhe@...hat.com>, linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org, catalin.marinas@....com,
thunder.leizhen@...wei.com, dyoung@...hat.com, prudo@...hat.com,
samuel.holland@...ive.com, kexec@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, x86@...nel.org
Subject: Re: [PATCH v2 1/8] crash_core.c: remove unnecessary parameter of
function
On 2023/8/29 20:16, Baoquan He wrote:
> In all call sites of __parse_crashkernel(), the parameter 'name' is
> hardcoded as "crashkernel=". So remove the unnecessary parameter 'name',
> add local varibale 'name' inside __parse_crashkernel() instead.
Reviewed-by: Zhen Lei <thunder.leizhen@...wei.com>
>
> Signed-off-by: Baoquan He <bhe@...hat.com>
> ---
> kernel/crash_core.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/crash_core.c b/kernel/crash_core.c
> index 90ce1dfd591c..f27b4e45d410 100644
> --- a/kernel/crash_core.c
> +++ b/kernel/crash_core.c
> @@ -241,11 +241,11 @@ static int __init __parse_crashkernel(char *cmdline,
> unsigned long long system_ram,
> unsigned long long *crash_size,
> unsigned long long *crash_base,
> - const char *name,
> const char *suffix)
> {
> char *first_colon, *first_space;
> char *ck_cmdline;
> + char *name = "crashkernel=";
>
> BUG_ON(!crash_size || !crash_base);
> *crash_size = 0;
> @@ -283,7 +283,7 @@ int __init parse_crashkernel(char *cmdline,
> unsigned long long *crash_base)
> {
> return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base,
> - "crashkernel=", NULL);
> + NULL);
> }
>
> int __init parse_crashkernel_high(char *cmdline,
> @@ -292,7 +292,7 @@ int __init parse_crashkernel_high(char *cmdline,
> unsigned long long *crash_base)
> {
> return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base,
> - "crashkernel=", suffix_tbl[SUFFIX_HIGH]);
> + suffix_tbl[SUFFIX_HIGH]);
> }
>
> int __init parse_crashkernel_low(char *cmdline,
> @@ -301,7 +301,7 @@ int __init parse_crashkernel_low(char *cmdline,
> unsigned long long *crash_base)
> {
> return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base,
> - "crashkernel=", suffix_tbl[SUFFIX_LOW]);
> + suffix_tbl[SUFFIX_LOW]);
> }
>
> /*
>
--
Regards,
Zhen Lei
Powered by blists - more mailing lists