linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] x86: apm: mark proc_apm_show as __maybe_unused
@ 2018-08-14  9:18 Arnd Bergmann
  2018-08-14  9:18 ` [PATCH 2/2] ARM: rpc: mark ecard_devices_proc_show " Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-08-14  9:18 UTC (permalink / raw)
  To: Alexander Viro, Jiri Kosina, x86
  Cc: Christoph Hellwig, Arnd Bergmann, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, linux-kernel

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.

Fixes: 3f3942aca6da ("proc: introduce proc_create_single{,_data}")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/kernel/apm_32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index ec00d1ff5098..79b5ed518471 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -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;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] ARM: rpc: mark ecard_devices_proc_show as __maybe_unused
  2018-08-14  9:18 [PATCH 1/2] x86: apm: mark proc_apm_show as __maybe_unused Arnd Bergmann
@ 2018-08-14  9:18 ` Arnd Bergmann
  2018-08-17  6:43 ` [PATCH 1/2] x86: apm: mark proc_apm_show " Christoph Hellwig
  2018-08-20 15:40 ` Thomas Gleixner
  2 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-08-14  9:18 UTC (permalink / raw)
  To: Alexander Viro, Russell King
  Cc: Christoph Hellwig, Arnd Bergmann, linux-arm-kernel, linux-kernel

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.

Fixes: 3f3942aca6da ("proc: introduce proc_create_single{,_data}")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-rpc/ecard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c
index 6fb51d49ad26..761a629f9e9d 100644
--- a/arch/arm/mach-rpc/ecard.c
+++ b/arch/arm/mach-rpc/ecard.c
@@ -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;
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] x86: apm: mark proc_apm_show as __maybe_unused
  2018-08-14  9:18 [PATCH 1/2] x86: apm: mark proc_apm_show as __maybe_unused Arnd Bergmann
  2018-08-14  9:18 ` [PATCH 2/2] ARM: rpc: mark ecard_devices_proc_show " Arnd Bergmann
@ 2018-08-17  6:43 ` Christoph Hellwig
  2018-08-20 15:40 ` Thomas Gleixner
  2 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2018-08-17  6:43 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexander Viro, Jiri Kosina, x86, Christoph Hellwig,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, linux-kernel

On Tue, Aug 14, 2018 at 11:18:45AM +0200, Arnd Bergmann wrote:
> 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.
> 
> Fixes: 3f3942aca6da ("proc: introduce proc_create_single{,_data}")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] x86: apm: mark proc_apm_show as __maybe_unused
  2018-08-14  9:18 [PATCH 1/2] x86: apm: mark proc_apm_show as __maybe_unused Arnd Bergmann
  2018-08-14  9:18 ` [PATCH 2/2] ARM: rpc: mark ecard_devices_proc_show " Arnd Bergmann
  2018-08-17  6:43 ` [PATCH 1/2] x86: apm: mark proc_apm_show " Christoph Hellwig
@ 2018-08-20 15:40 ` Thomas Gleixner
  2018-08-20 16:11   ` Arnd Bergmann
  2 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2018-08-20 15:40 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexander Viro, Jiri Kosina, x86, Christoph Hellwig, Ingo Molnar,
	H. Peter Anvin, LKML

On Tue, 14 Aug 2018, Arnd Bergmann wrote:

> 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.
>
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] x86: apm: mark proc_apm_show as __maybe_unused
  2018-08-20 15:40 ` Thomas Gleixner
@ 2018-08-20 16:11   ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-08-20 16:11 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Al Viro, Jiri Kosina, the arch/x86 maintainers,
	Christoph Hellwig, Ingo Molnar, H. Peter Anvin,
	Linux Kernel Mailing List

On Mon, Aug 20, 2018 at 5:40 PM Thomas Gleixner <tglx@linutronix.de> wrote:
>
> On Tue, 14 Aug 2018, Arnd Bergmann wrote:
>
> > 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.
> >
> > 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-20 16:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-14  9:18 [PATCH 1/2] x86: apm: mark proc_apm_show as __maybe_unused Arnd Bergmann
2018-08-14  9:18 ` [PATCH 2/2] ARM: rpc: mark ecard_devices_proc_show " Arnd Bergmann
2018-08-17  6:43 ` [PATCH 1/2] x86: apm: mark proc_apm_show " Christoph Hellwig
2018-08-20 15:40 ` Thomas Gleixner
2018-08-20 16:11   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).