lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DDN4GPV4RONM.1Z2JDM26J7D8E@bootlin.com>
Date: Mon, 20 Oct 2025 13:44:43 +0200
From: Théo Lebrun <theo.lebrun@...tlin.com>
To: "David Laight" <david.laight.linux@...il.com>,
 Théo Lebrun <theo.lebrun@...tlin.com>
Cc: "Andrew Lunn" <andrew+netdev@...n.ch>, "David S. Miller"
 <davem@...emloft.net>, "Eric Dumazet" <edumazet@...gle.com>, "Jakub
 Kicinski" <kuba@...nel.org>, "Paolo Abeni" <pabeni@...hat.com>, "Rob
 Herring" <robh@...nel.org>, "Krzysztof Kozlowski" <krzk+dt@...nel.org>,
 "Conor Dooley" <conor+dt@...nel.org>, "Nicolas Ferre"
 <nicolas.ferre@...rochip.com>, "Claudiu Beznea" <claudiu.beznea@...on.dev>,
 "Richard Cochran" <richardcochran@...il.com>, "Russell King"
 <linux@...linux.org.uk>, <netdev@...r.kernel.org>,
 <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>, "Vladimir
 Kondratiev" <vladimir.kondratiev@...ileye.com>, "Tawfik Bayouk"
 <tawfik.bayouk@...ileye.com>, "Thomas Petazzoni"
 <thomas.petazzoni@...tlin.com>, Grégory Clement
 <gregory.clement@...tlin.com>, Benoît Monin
 <benoit.monin@...tlin.com>, "Maxime Chevallier"
 <maxime.chevallier@...tlin.com>
Subject: Re: [PATCH net-next 11/15] net: macb: replace min() with umin()
 calls

On Sun Oct 19, 2025 at 4:10 PM CEST, David Laight wrote:
> On Tue, 14 Oct 2025 17:25:12 +0200
> Théo Lebrun <theo.lebrun@...tlin.com> wrote:
>
>> Whenever min(a, b) is used with a and b unsigned variables or literals,
>> `make W=2` complains. Change four min() calls into umin().
>
> It will, and you'll get the same 'error' all over the place.
> Basically -Wtype-limits is broken.
>
> Don't remove valid checks because it bleats.

In theory I agree. In practice, this patch leads to a more readable
`make W=2 drivers/net/ethernet/cadence/` stderr output, by removing a
few false positives, and that's my only desire (not quite).

I am not sure what you mean by "Don't remove valid checks"; could you
clarify? My understanding is that the warning checks are about the
signedness of unsigned integers. Are you implying that we lose
something (safety?) when switching from min(a, b) to umin(a, b) with
a/b both unsigned ints?

Thanks David,

[0]: https://lore.kernel.org/lkml/176066582948.1978978.752807229943547484.git-patchwork-notify@kernel.org/
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=f26c6438a285

--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ