[Devel] [PATCH rh7] RDMA/ocrdma: Remove unused STAG array.

Andrey Ryabinin aryabinin at virtuozzo.com
Mon Apr 1 12:22:51 MSK 2019


Since commit 191cfed565c0 ("RDMA/ocrdma: Remove old FRWR API")
the STAG array isn't used. Remove it.

https://pmc.acronis.com/browse/VSTOR-21732
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 drivers/infiniband/hw/ocrdma/ocrdma.h       | 1 -
 drivers/infiniband/hw/ocrdma/ocrdma_main.c  | 5 -----
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 --
 3 files changed, 8 deletions(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h
index 7baedc74e39d..79c10df008d7 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma.h
+++ b/drivers/infiniband/hw/ocrdma/ocrdma.h
@@ -286,7 +286,6 @@ struct ocrdma_dev {
 
 	struct list_head entry;
 	int id;
-	u64 *stag_arr;
 	u8 sl; /* service level */
 	bool pfc_state;
 	atomic_t update_sl;
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
index 067ed7f4903e..745035d13463 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
@@ -235,10 +235,6 @@ static int ocrdma_alloc_resources(struct ocrdma_dev *dev)
 			goto alloc_err;
 	}
 
-	dev->stag_arr = kzalloc(sizeof(u64) * OCRDMA_MAX_STAG, GFP_KERNEL);
-	if (dev->stag_arr == NULL)
-		goto alloc_err;
-
 	ocrdma_alloc_pd_pool(dev);
 
 	if (!ocrdma_alloc_stats_resources(dev)) {
@@ -257,7 +253,6 @@ static int ocrdma_alloc_resources(struct ocrdma_dev *dev)
 static void ocrdma_free_resources(struct ocrdma_dev *dev)
 {
 	ocrdma_release_stats_resources(dev);
-	kfree(dev->stag_arr);
 	kfree(dev->qp_tbl);
 	kfree(dev->cq_tbl);
 }
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index fc767dd92b25..071bfd170df1 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -3051,8 +3051,6 @@ struct ib_mr *ocrdma_alloc_mr(struct ib_pd *ibpd,
 		goto mbx_err;
 	mr->ibmr.rkey = mr->hwmr.lkey;
 	mr->ibmr.lkey = mr->hwmr.lkey;
-	dev->stag_arr[(mr->hwmr.lkey >> 8) & (OCRDMA_MAX_STAG - 1)] =
-		(unsigned long) mr;
 	return &mr->ibmr;
 mbx_err:
 	ocrdma_free_mr_pbl_tbl(dev, &mr->hwmr);
-- 
2.19.2



More information about the Devel mailing list