From: Dan Carpenter <dan.carpenter@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-alpha@vger.kernel.org
Subject: Re: [bug report] Linux-2.6.12-rc2
Date: Mon, 2 Jun 2025 10:33:08 +0300 [thread overview]
Message-ID: <aD1TtLMZT3enaFQj@stanley.mountain> (raw)
In-Reply-To: <db221c64-0653-41c5-acfa-f7cb9e831150@app.fastmail.com>
On Fri, May 30, 2025 at 07:46:20AM +0200, Arnd Bergmann wrote:
> On Wed, May 28, 2025, at 10:10, Dan Carpenter wrote:
> >
> > arch/alpha/kernel/err_marvel.c:884 marvel_find_io7_with_error() warn:
> > statement has no effect 'csrs->POx_ERR_SUM.csr'
> > arch/alpha/kernel/err_marvel.c:892 marvel_find_io7_with_error() warn:
> > statement has no effect 'io7->csrs->PO7_ERROR_SUM.csr'
> >
>
> > I occasionally try to run Smatch against code that I can't actually
> > compile and it found this code from before the git era. These days
> > we build with -Wall and so this kind of code doesn't normally compile
> > on x86 or Arm. We would get a warning like:
> >
> > test.c:18:9: warning: statement with no effect [-Wunused-value]
> > 18 | x;
> > | ^
> >
> > So it makes me wonder if this code can actually build?
> >
>
> FWIW, I tried building the file with gcc-15 and don't see a
> warning for that construct, even with the -Wextra.
>
> After digging around some more, I found that this is the
> definition of the structure, and that the 'volatile' in there
> causes gcc and clang to not consider the statement to be
> free of side-effects. I assume it will actually cause a
> load from an MMIO register here:
>
> typedef struct {
> volatile unsigned long csr __attribute__((aligned(64)));
> } io7_csr;
Huh. Thanks, Arnd. I hadn't even considered that.
regards,
dan carpenter
prev parent reply other threads:[~2025-06-02 7:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-28 8:10 [bug report] Linux-2.6.12-rc2 Dan Carpenter
2025-05-30 5:46 ` Arnd Bergmann
2025-06-02 7:33 ` Dan Carpenter [this message]
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=aD1TtLMZT3enaFQj@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=arnd@arndb.de \
--cc=linux-alpha@vger.kernel.org \
/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