lkml.org 
[lkml]   [2021]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] bitops: Add single_bit_set()
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@fi.rohmeurope.com>
> ---
> 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


\
 
 \ /
  Last update: 2021-11-22 12:36    [W:0.097 / U:3.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site