Re: [PATCH v3 3/3] overflow: Remove is_non_negative() and is_negative()

Nicolas Schier <[email protected]> Thu, 1 Jan 2026 20:39:46 +0100
Newsgroups org.kernel.vger.linux-sparse,dev.linux.lists.llvm,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-hardening,org.kernel.vger.linux-kbuild,org.kernel.vger.linux-kernel
Message-ID <20260101-futuristic-petrel-of-ecstasy-23db5f@lindesnes>
On Thu, Jan 01, 2026 at 04:10:36PM +0100, Vincent Mailhol wrote:
> On 20/12/2025 at 12:02, Vincent Mailhol wrote:
> > The is_non_negative() and is_negative() function-like macros just
> > exist as a workaround to silence the -Wtype-limits warning. Now that
> > this warning is disabled, those two macros have lost their raison
> > d'ĂȘtre. Remove them.
> > 
> > This reverts commit dc7fe518b049 ("overflow: Fix -Wtype-limits
> > compilation warnings").
> > 
> > Suggested-by: Nicolas Schier <[email protected]>
> > Link: https://lore.kernel.org/all/[email protected]
> > Signed-off-by: Vincent Mailhol <[email protected]>
> 
> So at the end, this patch got five kernel test robot reports:
> 
>   https://lore.kernel.org/all/[email protected]/
>   https://lore.kernel.org/all/[email protected]/
>   https://lore.kernel.org/all/[email protected]/
>   https://lore.kernel.org/all/[email protected]/
>   https://lore.kernel.org/all/[email protected]/
> 
> All these are the same smatch warning just triggered from a different
> place. I think it is still too early to undo that workaround in
> include/linux/overflow.h, otherwise developers would be getting that
> smatch report too often.
> 
> I will send a v4 in which I will drop this patch. This basically means
> that the v4 is a revert to v1...

thanks!  I think it's a bit sad to keep code only to make some checker 
tooling happy, but for now it seems to be the right thing to do.

Kind Regards,
Nicolas
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEh0E3p4c3JKeBvsLGB1IKcBYmEmkFAmlWzYIACgkQB1IKcBYm
Emkv5A/+JGh8gXsgclOmUAW84XlSnEuwIhRXs3PO+BaFvveNaRIkkKUPw6dsHWDR
VlbsSCp/6fyRrH5A2UQ8i7mAgkaFPrmi76d50HrYsMDFDPcCmmFkQP+6UTSvymZo
KBiXwBoypXpUzcUaoWPmwhMfWH+0Ov4IMj6Suy808QAaESPPwJORFmd7zTl7ZE3i
zUibhRVpU3qlgcV0ZcpJAkx4KJFHc0ADv9GTAmWTeBHGMsqWk4xZaFCwLB8bv+IB
1l1X+7DjY9GzqupPzrfTZxeFZsrG/DVQAtKUutcbvZJPM8XWD9sHtb4oM9BEbQr8
ShaZ3CbtXBGo5MCzQCw/Sb9DGCYm66apPE3NWbcEFKPqLG4slF7PdQ8o1DyyDbjK
v8icj6elb23wmQGRd47aIVTcsFUeis+nJHAMnlQSMfVgDNB+trggaEHrzhcgP4Ff
IhouTrsvdLsqzz01Oa+XQfR4GkjBxL6nWZLMbbOlXmHin4iSKqLKiCWrc6lkPJ7I
d2F1JJoEH4XpbfdTV4YtsU+D3gpjywC7uGWSweHGTs8DihnQ/x5bwBUX3Bo98+pK
T59NTfnjD02v+802qjCKvOoM90j5dX1FUCqhekc8Nm+TUlC5UHDjtts8SAmf1x9u
OatEZU2f5zGPJBL91kVMQS7/psD1ZkDNucVtKBKX9gCveWFvVnQ=
=7eoQ
-----END PGP SIGNATURE-----