Re: [PATCH] bitmap: simplify GENMASK(size - 1, 0) lines

From: Andy Shevchenko
Date: Tue Oct 26 2021 - 11:11:22 EST


On Tue, Oct 26, 2021 at 10:41:08AM -0400, Qian Cai wrote:
> Since "size" is an "unsigned int", the rvalue "size - 1" will still be
> "unsigned int" according to the C standard (3.2.1.5 Usual arithmetic
> conversions). Therefore, GENMASK(size - 1, 0) will always return 0UL.

Huh?!

Have you run test_bitmap et al., btw?

--
With Best Regards,
Andy Shevchenko