diff options
author | Yangyang Li <liyangyang20@huawei.com> | 2021-06-10 14:50:10 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-06-21 21:42:53 +0300 |
commit | 1bc530c79d9346e3298359d4dbdbad204d078885 (patch) | |
tree | d446260199c0674b08b6a10e33c693df4771108c /drivers/infiniband/hw/hns/hns_roce_alloc.c | |
parent | 24977edbb5c5e342bf63c533f43bdcb55d48d9fd (diff) | |
download | linux-1bc530c79d9346e3298359d4dbdbad204d078885.tar.xz |
RDMA/hns: Remove the unused hns_roce_bitmap_free_range function
hns_roce_bitmap_free_range() is only called inside hns_roce_bitmap_free(),
and the input parameter "cnt" is set to a constant 1. In addition, the
driver does not use alloc_range scenarios, so free_range does not need to
exist.
Link: https://lore.kernel.org/r/1623325814-55737-3-git-send-email-liweihang@huawei.com
Signed-off-by: Yangyang Li <liyangyang20@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_alloc.c')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_alloc.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_alloc.c b/drivers/infiniband/hw/hns/hns_roce_alloc.c index 8b68f9375b2c..f950ec41a3f0 100644 --- a/drivers/infiniband/hw/hns/hns_roce_alloc.c +++ b/drivers/infiniband/hw/hns/hns_roce_alloc.c @@ -66,20 +66,10 @@ int hns_roce_bitmap_alloc(struct hns_roce_bitmap *bitmap, unsigned long *obj) void hns_roce_bitmap_free(struct hns_roce_bitmap *bitmap, unsigned long obj, int rr) { - hns_roce_bitmap_free_range(bitmap, obj, 1, rr); -} - -void hns_roce_bitmap_free_range(struct hns_roce_bitmap *bitmap, - unsigned long obj, int cnt, - int rr) -{ - int i; - obj &= bitmap->max + bitmap->reserved_top - 1; spin_lock(&bitmap->lock); - for (i = 0; i < cnt; i++) - clear_bit(obj + i, bitmap->table); + clear_bit(obj, bitmap->table); if (!rr) bitmap->last = min(bitmap->last, obj); |