All of lore.kernel.org
 help / color / mirror / Atom feed
From: Weihang Li <liweihang@huawei.com>
To: <dledford@redhat.com>, <jgg@nvidia.com>
Cc: <leon@kernel.org>, <linux-rdma@vger.kernel.org>,
	<linuxarm@huawei.com>, Yangyang Li <liyangyang20@huawei.com>,
	Weihang Li <liweihang@huawei.com>
Subject: [PATCH for-next 2/6] RDMA/hns: Remove the unused hns_roce_bitmap_free_range function
Date: Thu, 10 Jun 2021 19:50:10 +0800	[thread overview]
Message-ID: <1623325814-55737-3-git-send-email-liweihang@huawei.com> (raw)
In-Reply-To: <1623325814-55737-1-git-send-email-liweihang@huawei.com>

From: Yangyang Li <liyangyang20@huawei.com>

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.

Signed-off-by: Yangyang Li <liyangyang20@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_alloc.c  | 12 +-----------
 drivers/infiniband/hw/hns/hns_roce_device.h |  3 ---
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_alloc.c b/drivers/infiniband/hw/hns/hns_roce_alloc.c
index 8b68f93..f950ec4 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);
diff --git a/drivers/infiniband/hw/hns/hns_roce_device.h b/drivers/infiniband/hw/hns/hns_roce_device.h
index 0048e5f..cbf3b9b 100644
--- a/drivers/infiniband/hw/hns/hns_roce_device.h
+++ b/drivers/infiniband/hw/hns/hns_roce_device.h
@@ -1163,9 +1163,6 @@ int hns_roce_bitmap_init(struct hns_roce_bitmap *bitmap, u32 num, u32 mask,
 			 u32 reserved_bot, u32 resetrved_top);
 void hns_roce_bitmap_cleanup(struct hns_roce_bitmap *bitmap);
 void hns_roce_cleanup_bitmap(struct hns_roce_dev *hr_dev);
-void hns_roce_bitmap_free_range(struct hns_roce_bitmap *bitmap,
-				unsigned long obj, int cnt,
-				int rr);
 
 int hns_roce_create_ah(struct ib_ah *ah, struct rdma_ah_init_attr *init_attr,
 		       struct ib_udata *udata);
-- 
2.7.4


  parent reply	other threads:[~2021-06-10 11:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 11:50 [PATCH for-next 0/6] RDMA/hns: Use ida to manage index of some resources Weihang Li
2021-06-10 11:50 ` [PATCH for-next 1/6] RDMA/hns: Remove the unused hns_roce_bitmap_alloc_range function Weihang Li
2021-06-10 11:50 ` Weihang Li [this message]
2021-06-10 11:50 ` [PATCH for-next 3/6] RDMA/hns: Remove unused RR mechanism Weihang Li
2021-06-10 11:50 ` [PATCH for-next 4/6] RDMA/hns: Use IDA interface to manage mtpt index Weihang Li
2021-06-10 11:50 ` [PATCH for-next 5/6] RDMA/hns: Use IDA interface to manage pd index Weihang Li
2021-06-10 11:50 ` [PATCH for-next 6/6] RDMA/hns: Use IDA interface to manage xrcd index Weihang Li
2021-06-21 18:43 ` [PATCH for-next 0/6] RDMA/hns: Use ida to manage index of some resources Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1623325814-55737-3-git-send-email-liweihang@huawei.com \
    --to=liweihang@huawei.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liyangyang20@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.