diff options
author | Yury Norov <yury.norov@gmail.com> | 2022-02-09 15:54:34 -0800 |
---|---|---|
committer | Yury Norov <yury.norov@gmail.com> | 2022-05-02 06:30:40 -0700 |
commit | 5f8dac3fc7bae246cc666d0df1ba37fc077efc3d (patch) | |
tree | b5deea1c01c92227027f60385ce72282c53d88fd /drivers/net | |
parent | 2b330a6a6c21a9b9f4ce71e5c0be494ab577423c (diff) | |
download | linux-stable-5f8dac3fc7bae246cc666d0df1ba37fc077efc3d.tar.gz linux-stable-5f8dac3fc7bae246cc666d0df1ba37fc077efc3d.tar.bz2 linux-stable-5f8dac3fc7bae246cc666d0df1ba37fc077efc3d.zip |
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.
Signed-off-by: Yury Norov <yury.norov@gmail.com>
Acked-by: Prabhakar Kushwaha <pkushwaha@marvell.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_roce.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c b/drivers/net/ethernet/qlogic/qed/qed_roce.c index 071b4aeaddf2..134ecfca96a3 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_roce.c +++ b/drivers/net/ethernet/qlogic/qed/qed_roce.c @@ -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 |