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

From: Al Viro
Date: Tue Aug 23 2022 - 23:20:18 EST


On Wed, Aug 24, 2022 at 04:10:25AM +0100, Al Viro wrote:
> *IF* you want to go that way, I would suggest a new return value for
> restricted_binop() ("comparison with magical value"), with
> something like
> switch (restricted_binop(op, ctype)) {
> case 1:
> ....
>
> default:
> break;
> case 4:
> // comparison with magic value:
> // quietly go for underlying type, if not fouled
> // if fouled, just return NULL and let the caller
> // deal with that - loudly.
> if (!(lclass & rclass & TYPE_FOULED))

if (!((lclass | rclass) & TYPE_FOULED))

that is - we don't need both of them being fouled to trigger a warning;
either one should suffice.