From: "Arnd Bergmann" <arnd@arndb.de>
To: "Simon Horman" <horms@kernel.org>, "Arnd Bergmann" <arnd@kernel.org>
Cc: "Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@kernel.org>, Netdev <netdev@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] myri10ge: avoid uninitialized variable use
Date: Sat, 21 Jun 2025 11:21:09 +0200 [thread overview]
Message-ID: <75623e39-14da-4e4d-8129-790ed08b66ae@app.fastmail.com> (raw)
In-Reply-To: <20250621074915.GG9190@horms.kernel.org>
On Sat, Jun 21, 2025, at 09:49, Simon Horman wrote:
> On Fri, Jun 20, 2025 at 01:26:28PM +0200, Arnd Bergmann wrote:
>>
>> It would be nice to understand how to make other compilers catch this as
>> well, but for the moment I'll just shut up the warning by fixing the
>> undefined behavior in this driver.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Hi Arnd,
>
> That is a lovely mess.
>
> Curiously I was not able to reproduce this on s390 with gcc 10.5.0.
> Perhaps I needed to try harder. Or perhaps the detection is specific to a
> very narrow set of GCC versions.
I was using my gcc binaries from
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/arm64/10.5.0/
but more likely this is kernel configuration specific than the exact
toolchain version.
The warning clearly depends on the myri10ge_send_cmd() function getting
inlined into the caller, and inlining is highly configuration specific.
See https://pastebin.com/T23wHkCx for the .config I used to produce
this.
> Regardless I agree with your analysis, but I wonder if the following is
> also needed so that .data0, 1 and 2 are always initialised when used.
Right, I stopped adding initializations when all the warnings were
gone, so I missed the ones you found. ;-)
I've integrated your changes now, let me know if I should resend it
right away, or you want to play around with that .config some more
first and reproduce the warning.
Arnd
next prev parent reply other threads:[~2025-06-21 9:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 11:26 [PATCH] myri10ge: avoid uninitialized variable use Arnd Bergmann
2025-06-21 7:49 ` Simon Horman
2025-06-21 9:21 ` Arnd Bergmann [this message]
2025-06-21 18:10 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=75623e39-14da-4e4d-8129-790ed08b66ae@app.fastmail.com \
--to=arnd@arndb.de \
--cc=andrew+netdev@lunn.ch \
--cc=arnd@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox