Skip to contentSkip to conversation

RDMA/irdma: One variable err is enough

PATCH Applied Zhu Yanjun 2 participants 2 messages Jan 3, 2023 – Jan 4, 2023

Subsystems (2)
lore
Share & tools
lore

Zhu Yanjun

author
#0 lore raw

PATCH 1/1 RDMA/irdma: One variable err is enough

From: Zhu Yanjun <[email protected]>

In the function irdma_reg_user_mr, err and ret exist. Actually, one variable err is enough.

---
 drivers/infiniband/hw/irdma/verbs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/infiniband/hw/irdma/verbs.c +2 -3
index f6973ea55eda..f4674ecf9c8c 100644
@@ -2771,7 +2771,6 @@ static struct ib_mr *irdma_reg_user_mr(struct ib_pd *pd, u64 start, u64 len,
 	bool use_pbles = false;
 	unsigned long flags;
 	int err = -EINVAL;
-	int ret;
 
 	if (len > iwdev->rf->sc_dev.hw_attrs.max_mr_size)
 		return ERR_PTR(-EINVAL);
@@ -2871,9 +2870,9 @@ static struct ib_mr *irdma_reg_user_mr(struct ib_pd *pd, u64 start, u64 len,
 			goto error;
 
 		if (use_pbles) {
-			ret = irdma_check_mr_contiguous(palloc,
+			err = irdma_check_mr_contiguous(palloc,
 							iwmr->page_size);
-			if (ret) {
+			if (err) {
 				irdma_free_pble(iwdev->rf->pble_rsrc, palloc);
 				iwpbl->pbl_allocated = false;
 			}
Signature · 1 line
2.34.1