Re: [PATCH 1/4] bitops: Add single_bit_set()

From: Andy Shevchenko
Date: Mon Nov 22 2021 - 06:28:20 EST


On Mon, Nov 22, 2021 at 01:03:25PM +0200, Matti Vaittinen wrote:
> There are cases when it is useful to check a bit-mask has only one bit
> set. Add a generic helper for it instead of baking own one for each
> user.
>
> Signed-off-by: Matti Vaittinen <matti.vaittinen@xxxxxxxxxxxxxxxxx>
> ---
> I am not at all sure what would be the best place for this. Please let
> me know if you think some other file would be more appropriate.

So, you decided to reinvent hamming weight...
Please, drop this patch and use corresponding hweight() call.

--
With Best Regards,
Andy Shevchenko