x86: apm: mark proc_apm_show as __maybe_unused
Subsystems (5)
PATCH 1/2 x86: apm: mark proc_apm_show as __maybe_unused
A new build error appeared with CONFIG_PROC_FS disabled:
arch/x86/kernel/apm_32.c:1643:12: error: 'proc_apm_show' defined but not used [-Werror=unused-function]
This marks the function as __maybe_unused to let the compiler drop it silently.
--- arch/x86/kernel/apm_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/apm_32.c +1 -1
@@ -1640,7 +1640,7 @@ static int do_open(struct inode *inode, struct file *filp)return 0 ; } -static int proc_apm_show (struct seq_file *m,void *v) +static int __maybe_unused proc_apm_show (struct seq_file *m,void *v) {unsigned short bx;unsigned short cx;
Signature · 1 line
2.18.0
PATCH 2/2 ARM: rpc: mark ecard_devices_proc_show as __maybe_unused
A new build error appeared with CONFIG_PROC_FS disabled:
arch/arm/mach-rpc/ecard.c:646:12: error: 'ecard_devices_proc_show' defined but not used [-Werror=unused-function]
This marks the function as __maybe_unused to let the compiler drop it silently.
--- arch/arm/mach-rpc/ecard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-rpc/ecard.c +1 -1
@@ -643,7 +643,7 @@ static int ecard_prints(struct seq_file *m, ecard_t *ec)return 0 ; } -static int ecard_devices_proc_show (struct seq_file *m,void *v) +static int __maybe_unused ecard_devices_proc_show (struct seq_file *m,void *v) {ecard_t *ec = cards;
Signature · 1 line
2.18.0
Quoted 9 lines · Arnd Bergmann
A new build error appeared with
CONFIG_PROC_FSdisabled:
arch/x86/kernel/apm_32.c:1643:12: error: 'proc_apm_show' defined but not used [-Werror=unused-function]This marks the function as
__maybe_unusedto let the compiler drop it silently.Fixes 3f3942aca6da ("proc: introduce proc_create_single{,_data}")Signed-off-by Arnd Bergmann <[email protected]>
I have to admit I actually prefer ifdefs over magic __maybe_unused annotations. But otherwise this looks correct to me, same for the other patch.
Quoted 8 lines · Arnd Bergmann
A new build error appeared with
CONFIG_PROC_FSdisabled:
arch/x86/kernel/apm_32.c:1643:12: error: 'proc_apm_show' defined but not used [-Werror=unused-function]This marks the function as
__maybe_unusedto let the compiler drop it silently.Fixes 3f3942aca6da ("proc: introduce proc_create_single{,_data}")
The proper fix for this is to convert the stub function for proc_apm_show() to an inline. The compiler complains because the stub is a macro ....
Thanks,
tglx
Quoted 7 lines · Thomas Gleixner
Quoted 4 lines · Arnd Bergmann
A new build error appeared with
CONFIG_PROC_FSdisabled:
arch/x86/kernel/apm_32.c:1643:12: error: 'proc_apm_show' defined but not used [-Werror=unused-function]
Quoted 7 lines
Quoted 4 lines
This marks the function as
__maybe_unusedto let the compiler drop it silently.Fixes 3f3942aca6da ("proc: introduce proc_create_single{,_data}")The proper fix for this is to convert the stub function for
proc_apm_show()to an inline. The compiler complains because the stub is a macro ....
I even did that
https://patchwork.ozlabs.org/patch/920786/
but then a handful of patches went into the kernel to add #ifdefs around the other proc_show functions, so it no longer applied. These two are the only remaining ones.
Arnd