History

qed: replace bitmap_weight with bitmap_empty in qed_roce_stop()

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.

Yury Norov committed 4 years ago

Commit 5f8dac31 parent 2b330a61 file · +1 −1Browse files

Unified · Split

drivers/net/ethernet/qlogic/qed/qed_roce.c+1−1
@@ -76,7 +76,7 @@ void qed_roce_stop(struct qed_hwfn *p_hwfn) · 75 unmodified lines
7676 * We delay for a short while if an async destroy QP is still expected.
7777 * Beyond the added delay we clear the bitmap anyway.
7878 */
79− while (bitmap_weight(rcid_map->bitmap, rcid_map->max_count)) {
79+ while (!bitmap_empty(rcid_map->bitmap, rcid_map->max_count)) {
8080 /* If the HW device is during recovery, all resources are
8181 * immediately reset without receiving a per-cid indication
8282 * from HW. In this case we don't expect the cid bitmap to be

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t