RE: [PATCH 11/49] qed: replace bitmap_weight with bitmap_empty in qed_roce_stop()

From: Prabhakar Kushwaha <hidden>
Date: 2022-02-15 05:35:54
Also in: lkml

Hi Yury,
-----Original Message-----
From: Prabhakar Kushwaha <redacted>
Sent: Tuesday, February 15, 2022 10:41 AM
To: Prabhakar Kushwaha <redacted>
Subject: [PATCH 11/49] qed: replace bitmap_weight with
bitmap_empty in qed_roce_stop()

Subject:  [PATCH 11/49] qed: replace bitmap_weight with bitmap_empty in
qed_roce_stop()
Date:  Thu, 10 Feb 2022 14:48:55 -0800
From:  Yury Norov mailto:yury.norov@gmail.com
To:  Yury Norov mailto:yury.norov@gmail.com, Andy Shevchenko
mailto:andriy.shevchenko@linux.intel.com, Rasmus Villemoes
mailto:linux@rasmusvillemoes.dk, Andrew Morton mailto:akpm@linux-
foundation.org, Michał Mirosław mailto:mirq-linux@rere.qmqm.pl, Greg Kroah-
Hartman mailto:gregkh@linuxfoundation.org, Peter Zijlstra
mailto:peterz@infradead.org, David Laight mailto:David.Laight@aculab.com,
Joe Perches mailto:joe@perches.com, Dennis Zhou mailto:dennis@kernel.org,
Emil Renner Berthing mailto:kernel@esmil.dk, Nicholas Piggin
mailto:npiggin@gmail.com, Matti Vaittinen
mailto:matti.vaittinen@fi.rohmeurope.com, Alexey Klimov
mailto:aklimov@redhat.com, mailto:linux-kernel@vger.kernel.org, Ariel Elior
mailto:aelior@marvell.com, Manish Chopra mailto:manishc@marvell.com,
David S. Miller mailto:davem@davemloft.net, Jakub Kicinski
mailto:kuba@kernel.org, mailto:netdev@vger.kernel.org


qed_roce_stop() calls bitmap_weight() to check if any bit of a given
bitmap is set. We can do it more efficiently with bitmap_empty() because
bitmap_empty() stops traversing the bitmap as soon as it finds first set
bit, while bitmap_weight() counts all bits unconditionally.

Signed-off-by: Yury Norov mailto:yury.norov@gmail.com
---
Acked-by: Prabhakar Kushwaha <redacted>

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help