lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 10/54] net: ethernet: replace bitmap_weight with bitmap_empty for qlogic
On Sun, Jan 23, 2022 at 10:38:41AM -0800, Yury Norov wrote:
> qlogic/qed code calls bitmap_weight() to check if any bit of a given
> bitmap is set. It's better to use bitmap_empty() in that case because
> bitmap_empty() stops traversing the bitmap as soon as it finds first
> set bit, while bitmap_weight() counts all bits unconditionally.

> - if (bitmap_weight((unsigned long *)&pmap[item], 64 * 8))
> + if (!bitmap_empty((unsigned long *)&pmap[item], 64 * 8))

> - (bitmap_weight((unsigned long *)&pmap[item],
> + (!bitmap_empty((unsigned long *)&pmap[item],

Side note, these castings reminds me previous discussion and I'm wondering
if you have this kind of potentially problematic places in your TODO as
subject to fix.


--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2022-01-24 13:30    [W:0.416 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site