| Date | Mon, 24 Jan 2022 14:28:00 +0200 | From | Andy Shevchenko <> | Subject | Re: [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
|