lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 Sep 2023 15:41:44 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     linux-m68k@...ts.linux-m68k.org,
        Finn Thain <fthain@...ux-m68k.org>,
        Michael Schmitz <schmitzmic@...il.com>,
        Philip Blundell <philb@....org>,
        Greg Ungerer <gerg@...ux-m68k.org>,
        Joshua Thompson <funaho@...ai.org>,
        Sam Creasey <sammy@...my.net>,
        Laurent Vivier <laurent@...ier.eu>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 15/52] m68k: emu: Mark version[] __maybe_unused

Hi Arnd,

On Sat, Sep 9, 2023 at 4:07 PM Arnd Bergmann <arnd@...db.de> wrote:
> On Sat, Sep 9, 2023, at 14:12, Geert Uytterhoeven wrote:
> > On Sat, Sep 9, 2023 at 10:28 AM Arnd Bergmann <arnd@...db.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@...ux-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...
>
> Older compilers used to keep unused variables, and all versions
> still do when building with -O0 instead of the usual -O2.
>
> I can see on godbolt.org that gcc-1.27 did not have that optimization
> yet, while gcc-4.1 had it, but I haven't found any versions between
> those. I vaguely remember us throwing out the version strings from
> most kernel files a long time ago, possibly that was triggered by
> gcc no longer putting them into the object any more, but I can't
> find a reference for that.
>
> What I can see is that a lot of old network drivers have version
> strings like this one, but they are actually printed from the
> probe function, and lost their __devinitdata annotation in the past.

The version string in arch/m68k/emu/nfeth.c used to be __devinitdata,
too, but it was never printed.  So I'm just gonna silence the warning,
as this patch does.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ