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.
Unified · Split
| @@ -76,7 +76,7 @@ void qed_roce_stop(struct qed_hwfn *p_hwfn) · 75 unmodified lines | |||
| 76 | * We delay for a short while if an async destroy QP is still expected. | 76 | * We delay for a short while if an async destroy QP is still expected. |
| 77 | * Beyond the added delay we clear the bitmap anyway. | 77 | * Beyond the added delay we clear the bitmap anyway. |
| 78 | */ | 78 | */ |
| 79 | while (bitmap_weight(rcid_map->bitmap, rcid_map->max_count)) { | 79 | while (!bitmap_empty(rcid_map->bitmap, rcid_map->max_count)) { |
| 80 | /* If the HW device is during recovery, all resources are | 80 | /* If the HW device is during recovery, all resources are |
| 81 | * immediately reset without receiving a per-cid indication | 81 | * immediately reset without receiving a per-cid indication |
| 82 | * from HW. In this case we don't expect the cid bitmap to be | 82 | * from HW. In this case we don't expect the cid bitmap to be |