[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <76998b95-827a-4e71-8782-0990b204fcfa@app.fastmail.com>
Date: Sat, 09 Sep 2023 16:07:13 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Geert Uytterhoeven" <geert@...ux-m68k.org>
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
On Sat, Sep 9, 2023, at 14:12, Geert Uytterhoeven wrote:
> Hi Arnd,
>
> 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.
Arnd
Powered by blists - more mailing lists