RE: [PATCH] staging: r8188eu: remove local BIT macro

David Laight
2022-03-21T09:04:54Z

From: Dan Carpenter
> Sent: 21 March 2022 08:16
>
> This version is better, thanks!
>
> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> What the GCC devs should have done is run their checker on real code and
> silence the common false positives. There are a few ways to do this.
> You could make ~ a special case. They already ignore truncated sign
> extension so they could equally well ignore truncation when all it's a
> 32 bits which are all set to 1. Probably the best answer is to do both.

Or start using -(BIT_VALUE + 1) instead of ~BIT_VALUE :-)

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)