Re: [PATCH] compiler.h: Support 64-bit bitwise types in is_signed_type()

From: Linus Torvalds

Date: Thu Nov 19 2026 - 13:28:03 EST


On Wed, 18 Nov 2026 at 04:13, David Laight <david.laight.linux@xxxxxxxxx> wrote:
>
> The fields ought to be u64 - since that is how they are printed.

... but then the actual tracing side would be worse and either require
a stupid and incorrect cast, or actual work to turn it into host byte
order.

So clearly the printing side doesn't understand about byte order, but
that's a printing side issue (that nobody really cares abnout:
big-endian is dead, and good riddance).

That said: I think the right fix might actually be to just allow sign
extension of the constants 0/-1 inside sparse for bitwise types.

So the sparse warning "cast to restricted __le64" should just be
suppressed for the values that bitwise types already accept (all ones
and all zeroes).

Because all ones and all zeroes are by definition fine in bitwise
types. Bit orderign and meaning doesn't matter when all bits are
equal.

Linus