Re: [for-linus][PATCH 01/10] tracing: Suppress sparse warnings triggered by is_signed_type()

From: Linus Torvalds
Date: Tue Aug 23 2022 - 22:11:30 EST


On Tue, Aug 23, 2022 at 6:49 PM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> That's the
>
> > It does require that kernel change to make
> >
> > #define is_signed_type(type) (((type)(-1)) <= (type)0)
>
> part I was talking about.

Side note: I think you could move this into '<linux/compiler.h>' and that would

(a) make some conceptual sense (unlike "overflow.h" and "trace_events.h")

and

(b) mean it gets included automatically in both files.

overflow.h already explicitly includes compiler.h, and trace_events.h
gets it from

linux/ring_buffer.h -> linux/mm.h -> linux/bug.h -> asm/bug.h ->
linux/compiler.h

(it goes other wats too, but those ones are through arch-specific asm
headers, so the above is the first non-arch-specific unconditional
chain I found.

And yes, we should have some tool for sorting out these nasty header
chains. Some automated tool that says "You don't need header X,
because you already got it" or "You don't need headed X, because
nothing you do depends on it".

Linus