Re: [PATCH] x86/asm: Remove unused COMPILE_OFFSETS macro from asm-offsets.c

From: Vincent MAILHOL
Date: Mon Nov 28 2022 - 06:30:54 EST


On Mon. 28 Nov. 2022 at 20:11, <kirill.shutemov@xxxxxxxxxxxxxxx> wrote:
> On Mon, Nov 28, 2022 at 07:11:17PM +0900, Vincent Mailhol wrote:
> > On Mon, 28 Nov 2022 12:15:06 +0300, Kirill A. Shutemov wrote:
> > > On Sun, Nov 27, 2022 at 03:23:35PM +0900, Vincent Mailhol wrote:
> > > > Following [1], the macro COMPILE_OFFSETS becomes unused:
> > >
> > > Really? I see #ifdef COMPILE_OFFSETS in ftrace.h. Hm?
> > >
> > > Have you tested your patch with CONFIG_FTRACE_SYSCALLS=y and
> > > CONFIG_IA32_EMULATION=y?
> >
> > Even if I activate those two configurations, the compiler still
> > tells me it is unused:
> >
> > $ grep -E "CONFIG_FTRACE_SYSCALLS|CONFIG_IA32_EMULATION" .config
> > CONFIG_IA32_EMULATION=y
> > CONFIG_FTRACE_SYSCALLS=y
> >
> > $ make W=2 arch/x86/kernel/asm-offsets.o
> > <...>
> > arch/x86/kernel/asm-offsets.c:7: warning: macro "COMPILE_OFFSETS" is not used [-Wunused-macros]
> > <...>
>
> If you are sure <asm/ftrace.h> is never included from asm-offsets.c,
> remove #ifndef COMPILE_OFFSETS too.

It is never included from asm-offsets.c but it is still used by
kvm-asm-offsets.c:
https://elixir.bootlin.com/linux/v6.1-rc7/source/arch/x86/kvm/kvm-asm-offsets.c#L7