On 22/08/2022 20.45, Linus Torvalds wrote:
But we did have a sparse fix for it, didn't we? That fix required that
the '< (type)1' cast be changed to '<= (type)0' iirc, and a patch to
sparse, but it at least avoided the problem.
Heh. I originally wrote the comparison "< (t)1" instead of "< (t)0" to
avoid a -Wtype-limits warning when applied to unsigned types - yeah
yeah, the kernel isn't built with that, but it's a nice macro to
copy-paste to other projects, and sometimes people do explicitly enable
-Wtype-limits to manually go through some, and then it's nice to not
have tons of false positives from this macro.
But of course <1 is the same as <=0, and we can indeed spell it that way
without triggering Wtype-limits. So if that can help with also silencing
sparse, ack from me on that part.