Skip to content

Commit

Permalink
qed: replace bitmap_weight with bitmap_empty in qed_roce_stop()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Prabhakar Kushwaha <[email protected]>
  • Loading branch information
YuryNorov committed May 2, 2022
1 parent 2b330a6 commit 5f8dac3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/qlogic/qed/qed_roce.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void qed_roce_stop(struct qed_hwfn *p_hwfn)
* We delay for a short while if an async destroy QP is still expected.
* Beyond the added delay we clear the bitmap anyway.
*/
while (bitmap_weight(rcid_map->bitmap, rcid_map->max_count)) {
while (!bitmap_empty(rcid_map->bitmap, rcid_map->max_count)) {
/* If the HW device is during recovery, all resources are
* immediately reset without receiving a per-cid indication
* from HW. In this case we don't expect the cid bitmap to be
Expand Down

0 comments on commit 5f8dac3

Please sign in to comment.