Re: [GIT PULL] asm-generic fixes for 6.3

From: Linus Torvalds
Date: Thu Apr 06 2023 - 13:05:09 EST


On Thu, Apr 6, 2023 at 1:13 AM Arnd Bergmann <arnd@xxxxxxxx> wrote:
>
> Some of the less common I/O accessors are missing __force casts and
> cause sparse warnings for their implied byteswap, and a recent change
> to __generic_cmpxchg_local() causes a warning about constant integer
> truncation.

Ugh. I'm not super-happy about those casts, and maybe sparse should be
less chatty about these things. It shouldn't be impossible to have
sparse not warn about losing bits in casts in code that is statically
dead.

But we seem to have lost our sparse maintainer, so I've pulled this.

I also wish we had a size-specific version of "_Generic()" instead of
having to play games with "switch (sizeof(..))" like we traditionally
do.

But things like xchg() and user accesses really just care about the
size of the object, and there is no size-specific "_Generic()" thing,
and I can't think of any cute trick either.

Linus