From: David Laight <david.laight.linux@gmail.com>
To: Alexandre Ghiti <alex@ghiti.fr>
Cc: Christoph Hellwig <hch@lst.de>, kernel test robot <lkp@intel.com>,
oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Carlos Maiolino <cem@kernel.org>,
"Darrick J. Wong" <djwong@kernel.org>,
linux-riscv@lists.infradead.org
Subject: Re: fs/xfs/xfs_buf.c:1534 xfs_buf_submit_bio() warn: unsigned '_x' is never less than zero.
Date: Mon, 17 Feb 2025 13:12:03 +0000 [thread overview]
Message-ID: <20250217131203.2657cc4b@pumpkin> (raw)
In-Reply-To: <a14347d2-6189-49bc-a1cc-e5959e76e6c2@ghiti.fr>
On Mon, 17 Feb 2025 13:06:49 +0100
Alexandre Ghiti <alex@ghiti.fr> wrote:
> Hi Christoph,
>
> On 17/02/2025 10:24, Christoph Hellwig wrote:
> > On Mon, Feb 17, 2025 at 01:53:08PM +0800, kernel test robot wrote:
> >> New smatch warnings:
> >> fs/xfs/xfs_buf.c:1534 xfs_buf_submit_bio() warn: unsigned '_x' is never less than zero.
> > Looks like this is an issue in the riscv virt_to_page implementation
> > which also shows up in various other places. Any chance this could get
> > fixed in the riscv code?
>
>
> To me, the only test that could give rise to this warning is the last
> part of:
>
> #define is_linear_mapping(x) \
> ((x) >= PAGE_OFFSET && (!IS_ENABLED(CONFIG_64BIT) || (x) <
> PAGE_OFFSET + KERN_VIRT_SIZE))
>
> But given that the config is a 32-bit config, it should not be evaluated
> at all.
>
> Could that be a false-positive and then an issue in smatch?
Why is smatch even looking.
The equivalent check in gcc has been moved to -W2 because of all false positives.
David
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: David Laight <david.laight.linux@gmail.com>
To: Alexandre Ghiti <alex@ghiti.fr>
Cc: Christoph Hellwig <hch@lst.de>, kernel test robot <lkp@intel.com>,
oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Carlos Maiolino <cem@kernel.org>,
"Darrick J. Wong" <djwong@kernel.org>,
linux-riscv@lists.infradead.org
Subject: Re: fs/xfs/xfs_buf.c:1534 xfs_buf_submit_bio() warn: unsigned '_x' is never less than zero.
Date: Mon, 17 Feb 2025 13:12:03 +0000 [thread overview]
Message-ID: <20250217131203.2657cc4b@pumpkin> (raw)
In-Reply-To: <a14347d2-6189-49bc-a1cc-e5959e76e6c2@ghiti.fr>
On Mon, 17 Feb 2025 13:06:49 +0100
Alexandre Ghiti <alex@ghiti.fr> wrote:
> Hi Christoph,
>
> On 17/02/2025 10:24, Christoph Hellwig wrote:
> > On Mon, Feb 17, 2025 at 01:53:08PM +0800, kernel test robot wrote:
> >> New smatch warnings:
> >> fs/xfs/xfs_buf.c:1534 xfs_buf_submit_bio() warn: unsigned '_x' is never less than zero.
> > Looks like this is an issue in the riscv virt_to_page implementation
> > which also shows up in various other places. Any chance this could get
> > fixed in the riscv code?
>
>
> To me, the only test that could give rise to this warning is the last
> part of:
>
> #define is_linear_mapping(x) \
> ((x) >= PAGE_OFFSET && (!IS_ENABLED(CONFIG_64BIT) || (x) <
> PAGE_OFFSET + KERN_VIRT_SIZE))
>
> But given that the config is a 32-bit config, it should not be evaluated
> at all.
>
> Could that be a false-positive and then an issue in smatch?
Why is smatch even looking.
The equivalent check in gcc has been moved to -W2 because of all false positives.
David
next prev parent reply other threads:[~2025-02-17 13:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 5:53 fs/xfs/xfs_buf.c:1534 xfs_buf_submit_bio() warn: unsigned '_x' is never less than zero kernel test robot
2025-02-17 9:24 ` Christoph Hellwig
2025-02-17 9:24 ` Christoph Hellwig
2025-02-17 12:06 ` Alexandre Ghiti
2025-02-17 12:06 ` Alexandre Ghiti
2025-02-17 13:12 ` David Laight [this message]
2025-02-17 13:12 ` David Laight
2025-02-18 0:39 ` Philip Li
2025-02-18 0:39 ` Philip Li
2025-02-18 14:21 ` Dan Carpenter
2025-02-18 14:21 ` Dan Carpenter
2025-02-18 14:46 ` Alexandre Ghiti
2025-02-18 14:46 ` Alexandre Ghiti
2025-02-18 19:53 ` David Laight
2025-02-18 19:53 ` David Laight
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=20250217131203.2657cc4b@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=alex@ghiti.fr \
--cc=cem@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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.