From: Andreas Schwab <schwab@suse.de>
To: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: kernel test robot <lkp@intel.com>,
oe-kbuild-all@lists.linux.dev,
Palmer Dabbelt <palmer@rivosinc.com>,
Andrew Jones <ajones@ventanamicro.com>
Subject: Re: [linux-next:master 3383/4377] include/linux/atomic/atomic-arch-fallback.h:4152:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d)
Date: Wed, 19 Feb 2025 10:55:36 +0100 [thread overview]
Message-ID: <mvmjz9mxnqf.fsf@suse.de> (raw)
In-Reply-To: <CAHVXubgqm=E2qm_EKtYX4m8WHmt8Fjj0CZqh3Qxio0x_0G5EjA@mail.gmail.com> (Alexandre Ghiti's message of "Wed, 19 Feb 2025 10:38:59 +0100")
On Feb 19 2025, Alexandre Ghiti wrote:
> I don't get it, everything here is 64-bit and commit "riscv/atomic: Do
> proper sign extension also for unsigned in arch_cmpxchg" introduced a
> cast *only* for 32-bit values. Could that be a false-positive?
Yes, it is. All the arch_cmpxchg macros are type-generic macros, and
the path that casts the value is never executed if sizeof(*__ptr) == 8,
but sparse does not understand that (and gcc doesn't either when it
generates the -Wpointer-to-int-cast warning).
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
prev parent reply other threads:[~2025-02-19 9:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 4:51 [linux-next:master 3383/4377] include/linux/atomic/atomic-arch-fallback.h:4152:16: sparse: sparse: cast truncates bits from constant value (aaa31337c001d00d becomes c001d00d) kernel test robot
2025-02-19 9:38 ` Alexandre Ghiti
2025-02-19 9:55 ` Andreas Schwab [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=mvmjz9mxnqf.fsf@suse.de \
--to=schwab@suse.de \
--cc=ajones@ventanamicro.com \
--cc=alexghiti@rivosinc.com \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=palmer@rivosinc.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.