[15/52] m68k: emu: Mark version[] __maybe_unused

Message ID 64ea8cf65a4318fbf8c91cb3062d90a2555007c4.1694093327.git.geert@linux-m68k.org
State New
Headers
Series None |

Commit Message

Geert Uytterhoeven Sept. 7, 2023, 1:41 p.m. UTC
  When building with W=1:

    m68k/arch/m68k/emu/nfeth.c:42:19: warning: ‘version’ defined but not used [-Wunused-const-variable=]
       42 | static const char version[] =
	  |                   ^~~~~~~

Fix this while obeying the wishes of the original copyright holders by
marking version[] with __maybe_unused.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/emu/nfeth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Arnd Bergmann Sept. 9, 2023, 8:28 a.m. UTC | #1
On Thu, Sep 7, 2023, at 15:41, Geert Uytterhoeven wrote:
> When building with W=1:
>
>     m68k/arch/m68k/emu/nfeth.c:42:19: warning: ‘version’ defined but 
> not used [-Wunused-const-variable=]
>        42 | static const char version[] =
> 	  |                   ^~~~~~~
>
> Fix this while obeying the wishes of the original copyright holders by
> marking version[] with __maybe_unused.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

That will just drop it from the object file, maybe it should
instead be marked "__used" ?

      Arnd
  
Geert Uytterhoeven Sept. 9, 2023, 12:12 p.m. UTC | #2
Hi Arnd,

On Sat, Sep 9, 2023 at 10:28 AM Arnd Bergmann <arnd@arndb.de> wrote:
> On Thu, Sep 7, 2023, at 15:41, Geert Uytterhoeven wrote:
> > When building with W=1:
> >
> >     m68k/arch/m68k/emu/nfeth.c:42:19: warning: ‘version’ defined but
> > not used [-Wunused-const-variable=]
> >        42 | static const char version[] =
> >         |                   ^~~~~~~
> >
> > Fix this while obeying the wishes of the original copyright holders by
> > marking version[] with __maybe_unused.
> >
> > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
> That will just drop it from the object file, maybe it should
> instead be marked "__used" ?

Given it's been like this since the beginning, I guess it never showed
up in the object file anyway...

Gr{oetje,eeting}s,

                        Geert
  

Patch

diff --git a/arch/m68k/emu/nfeth.c b/arch/m68k/emu/nfeth.c
index 1a5d1e8eb4c80839..26e68813f35144f8 100644
--- a/arch/m68k/emu/nfeth.c
+++ b/arch/m68k/emu/nfeth.c
@@ -39,7 +39,7 @@  enum {
 #define MAX_UNIT	8
 
 /* These identify the driver base version and may not be removed. */
-static const char version[] =
+static const char version[] __maybe_unused =
 	KERN_INFO KBUILD_MODNAME ".c:v" DRV_VERSION " " DRV_RELDATE
 	" S.Opichal, M.Jurik, P.Stehlik\n"
 	KERN_INFO " http://aranym.org/\n";