2022-11-03 08:09:43

by Guo Ren

[permalink] [raw]
Subject: [PATCH -next V8 02/14] riscv: elf_kexec: Fixup compile warning

From: Guo Ren <[email protected]>

If CRYTPO or CRYPTO_SHA256 or KEXE_FILE is not enabled, then:

COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1
O=build_dir ARCH=riscv SHELL=/bin/bash arch/riscv/

../arch/riscv/kernel/elf_kexec.c: In function 'elf_kexec_load':
../arch/riscv/kernel/elf_kexec.c:185:23: warning: variable
'kernel_start' set but not used [-Wunused-but-set-variable]
185 | unsigned long kernel_start;
| ^~~~~~~~~~~~

Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file")
Signed-off-by: Guo Ren <[email protected]>
Signed-off-by: Guo Ren <[email protected]>
Reviewed-by: Conor Dooley <[email protected]>
Reported-by: kernel test robot <[email protected]>
---
arch/riscv/kernel/elf_kexec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/elf_kexec.c b/arch/riscv/kernel/elf_kexec.c
index 0cb94992c15b..4b9264340b78 100644
--- a/arch/riscv/kernel/elf_kexec.c
+++ b/arch/riscv/kernel/elf_kexec.c
@@ -198,7 +198,7 @@ static void *elf_kexec_load(struct kimage *image, char *kernel_buf,
if (ret)
goto out;
kernel_start = image->start;
- pr_notice("The entry point of kernel at 0x%lx\n", image->start);
+ pr_notice("The entry point of kernel at 0x%lx\n", kernel_start);

/* Add the kernel binary to the image */
ret = riscv_kexec_elf_load(image, &ehdr, &elf_info,
--
2.36.1



2022-12-05 09:48:49

by Björn Töpel

[permalink] [raw]
Subject: Re: [PATCH -next V8 02/14] riscv: elf_kexec: Fixup compile warning

[email protected] writes:

> From: Guo Ren <[email protected]>
>
> If CRYTPO or CRYPTO_SHA256 or KEXE_FILE is not enabled, then:
>
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1
> O=build_dir ARCH=riscv SHELL=/bin/bash arch/riscv/
>
> ../arch/riscv/kernel/elf_kexec.c: In function 'elf_kexec_load':
> ../arch/riscv/kernel/elf_kexec.c:185:23: warning: variable
> 'kernel_start' set but not used [-Wunused-but-set-variable]
> 185 | unsigned long kernel_start;
> | ^~~~~~~~~~~~
>
> Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file")
> Signed-off-by: Guo Ren <[email protected]>
> Signed-off-by: Guo Ren <[email protected]>
> Reviewed-by: Conor Dooley <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> ---
> arch/riscv/kernel/elf_kexec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/elf_kexec.c b/arch/riscv/kernel/elf_kexec.c
> index 0cb94992c15b..4b9264340b78 100644
> --- a/arch/riscv/kernel/elf_kexec.c
> +++ b/arch/riscv/kernel/elf_kexec.c
> @@ -198,7 +198,7 @@ static void *elf_kexec_load(struct kimage *image, char *kernel_buf,
> if (ret)
> goto out;
> kernel_start = image->start;
> - pr_notice("The entry point of kernel at 0x%lx\n", image->start);
> + pr_notice("The entry point of kernel at 0x%lx\n", kernel_start);

This patch shouldn't be part of the generic entry series. It's just a
generic fix! Please have this as a separate patch.

2022-12-06 04:50:41

by Guo Ren

[permalink] [raw]
Subject: Re: [PATCH -next V8 02/14] riscv: elf_kexec: Fixup compile warning

On Mon, Dec 5, 2022 at 5:13 PM Björn Töpel <[email protected]> wrote:
>
> [email protected] writes:
>
> > From: Guo Ren <[email protected]>
> >
> > If CRYTPO or CRYPTO_SHA256 or KEXE_FILE is not enabled, then:
> >
> > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1
> > O=build_dir ARCH=riscv SHELL=/bin/bash arch/riscv/
> >
> > ../arch/riscv/kernel/elf_kexec.c: In function 'elf_kexec_load':
> > ../arch/riscv/kernel/elf_kexec.c:185:23: warning: variable
> > 'kernel_start' set but not used [-Wunused-but-set-variable]
> > 185 | unsigned long kernel_start;
> > | ^~~~~~~~~~~~
> >
> > Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file")
> > Signed-off-by: Guo Ren <[email protected]>
> > Signed-off-by: Guo Ren <[email protected]>
> > Reviewed-by: Conor Dooley <[email protected]>
> > Reported-by: kernel test robot <[email protected]>
> > ---
> > arch/riscv/kernel/elf_kexec.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/riscv/kernel/elf_kexec.c b/arch/riscv/kernel/elf_kexec.c
> > index 0cb94992c15b..4b9264340b78 100644
> > --- a/arch/riscv/kernel/elf_kexec.c
> > +++ b/arch/riscv/kernel/elf_kexec.c
> > @@ -198,7 +198,7 @@ static void *elf_kexec_load(struct kimage *image, char *kernel_buf,
> > if (ret)
> > goto out;
> > kernel_start = image->start;
> > - pr_notice("The entry point of kernel at 0x%lx\n", image->start);
> > + pr_notice("The entry point of kernel at 0x%lx\n", kernel_start);
>
> This patch shouldn't be part of the generic entry series. It's just a
> generic fix! Please have this as a separate patch.
Okay

>


--
Best Regards
Guo Ren