diff mbox series

riscv: Remove unused GENERATING_ASM_OFFSETS

Message ID 20240816101912.1049329-1-zhangchunyan@iscas.ac.cn (mailing list archive)
State Accepted
Commit cb873b28bc2ad844df82ef70e3ab3c841777f347
Headers show
Series riscv: Remove unused GENERATING_ASM_OFFSETS | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR success PR summary
conchuod/patch-1-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-1-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-1-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-1-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-1-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-1-test-6 success .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-1-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-1-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-1-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-1-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-1-test-11 success .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-1-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

Chunyan Zhang Aug. 16, 2024, 10:19 a.m. UTC
The macro is not used in the current version of kernel, it looks like
can be removed to avoid a build warning:

../arch/riscv/kernel/asm-offsets.c: At top level:
../arch/riscv/kernel/asm-offsets.c:7: warning: macro "GENERATING_ASM_OFFSETS" is not used [-Wunused-macros]
    7 | #define GENERATING_ASM_OFFSETS

Fixes: 9639a44394b9 ("RISC-V: Provide a cleaner raw_smp_processor_id()")
Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
---
 arch/riscv/kernel/asm-offsets.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Alexandre Ghiti Aug. 16, 2024, 12:30 p.m. UTC | #1
Hi Chunyan,

On 16/08/2024 12:19, Chunyan Zhang wrote:
> The macro is not used in the current version of kernel, it looks like
> can be removed to avoid a build warning:
>
> ../arch/riscv/kernel/asm-offsets.c: At top level:
> ../arch/riscv/kernel/asm-offsets.c:7: warning: macro "GENERATING_ASM_OFFSETS" is not used [-Wunused-macros]
>      7 | #define GENERATING_ASM_OFFSETS

So this warning never shows up in a "normal" kernel compilation, but it 
happens when using W=2 (with quite a lot of other warnings).

This unused define indeed seems completely useless, I guess not all 
unused defines fall into this category and we should be careful when 
removing them, but for this one it makes sense so:

Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com>

Thanks,

Alex


>
> Fixes: 9639a44394b9 ("RISC-V: Provide a cleaner raw_smp_processor_id()")
> Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
> ---
>   arch/riscv/kernel/asm-offsets.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/arch/riscv/kernel/asm-offsets.c b/arch/riscv/kernel/asm-offsets.c
> index b09ca5f944f7..cb09f0c4f62c 100644
> --- a/arch/riscv/kernel/asm-offsets.c
> +++ b/arch/riscv/kernel/asm-offsets.c
> @@ -4,8 +4,6 @@
>    * Copyright (C) 2017 SiFive
>    */
>   
> -#define GENERATING_ASM_OFFSETS
> -
>   #include <linux/kbuild.h>
>   #include <linux/mm.h>
>   #include <linux/sched.h>
Chunyan Zhang Sept. 6, 2024, 1:34 a.m. UTC | #2
On Fri, 16 Aug 2024 at 20:30, Alexandre Ghiti <alex@ghiti.fr> wrote:
>
> Hi Chunyan,
>
> On 16/08/2024 12:19, Chunyan Zhang wrote:
> > The macro is not used in the current version of kernel, it looks like
> > can be removed to avoid a build warning:
> >
> > ../arch/riscv/kernel/asm-offsets.c: At top level:
> > ../arch/riscv/kernel/asm-offsets.c:7: warning: macro "GENERATING_ASM_OFFSETS" is not used [-Wunused-macros]
> >      7 | #define GENERATING_ASM_OFFSETS
>
> So this warning never shows up in a "normal" kernel compilation, but it
> happens when using W=2 (with quite a lot of other warnings).
>
> This unused define indeed seems completely useless, I guess not all
> unused defines fall into this category and we should be careful when
> removing them, but for this one it makes sense so:
>
> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com>

I think this should be ready to be merged.

Palmer, would you please pick this up to your tree? Or I can resend
the patch if that's more convenient for you.

Thanks,
Chunyan

>
> Thanks,
>
> Alex
>
>
> >
> > Fixes: 9639a44394b9 ("RISC-V: Provide a cleaner raw_smp_processor_id()")
> > Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
> > ---
> >   arch/riscv/kernel/asm-offsets.c | 2 --
> >   1 file changed, 2 deletions(-)
> >
> > diff --git a/arch/riscv/kernel/asm-offsets.c b/arch/riscv/kernel/asm-offsets.c
> > index b09ca5f944f7..cb09f0c4f62c 100644
> > --- a/arch/riscv/kernel/asm-offsets.c
> > +++ b/arch/riscv/kernel/asm-offsets.c
> > @@ -4,8 +4,6 @@
> >    * Copyright (C) 2017 SiFive
> >    */
> >
> > -#define GENERATING_ASM_OFFSETS
> > -
> >   #include <linux/kbuild.h>
> >   #include <linux/mm.h>
> >   #include <linux/sched.h>
patchwork-bot+linux-riscv@kernel.org Oct. 24, 2024, 6:10 p.m. UTC | #3
Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Fri, 16 Aug 2024 18:19:12 +0800 you wrote:
> The macro is not used in the current version of kernel, it looks like
> can be removed to avoid a build warning:
> 
> ../arch/riscv/kernel/asm-offsets.c: At top level:
> ../arch/riscv/kernel/asm-offsets.c:7: warning: macro "GENERATING_ASM_OFFSETS" is not used [-Wunused-macros]
>     7 | #define GENERATING_ASM_OFFSETS
> 
> [...]

Here is the summary with links:
  - riscv: Remove unused GENERATING_ASM_OFFSETS
    https://git.kernel.org/riscv/c/cb873b28bc2a

You are awesome, thank you!
diff mbox series

Patch

diff --git a/arch/riscv/kernel/asm-offsets.c b/arch/riscv/kernel/asm-offsets.c
index b09ca5f944f7..cb09f0c4f62c 100644
--- a/arch/riscv/kernel/asm-offsets.c
+++ b/arch/riscv/kernel/asm-offsets.c
@@ -4,8 +4,6 @@ 
  * Copyright (C) 2017 SiFive
  */
 
-#define GENERATING_ASM_OFFSETS
-
 #include <linux/kbuild.h>
 #include <linux/mm.h>
 #include <linux/sched.h>