[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220426070858.9098-1-guozhengkui@vivo.com>
Date: Tue, 26 Apr 2022 15:08:58 +0800
From: Guo Zhengkui <guozhengkui@...o.com>
To: Wenpeng Liang <liangwenpeng@...wei.com>,
Weihang Li <liweihang@...wei.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Leon Romanovsky <leon@...nel.org>,
linux-rdma@...r.kernel.org (open list:HISILICON ROCE DRIVER),
linux-kernel@...r.kernel.org (open list)
Cc: zhengkui_guo@...look.com, Guo Zhengkui <guozhengkui@...o.com>
Subject: [PATCH linux-next] RDMA/hns: fix returnvar.cocci warning
Fix the following coccicheck warning:
drivers/infiniband/hw/hns/hns_roce_mr.c:343:5-8: Unneeded variable: "ret".
Return "0" on line 351.
Signed-off-by: Guo Zhengkui <guozhengkui@...o.com>
---
drivers/infiniband/hw/hns/hns_roce_mr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_mr.c b/drivers/infiniband/hw/hns/hns_roce_mr.c
index b389738d157f..867972c2a894 100644
--- a/drivers/infiniband/hw/hns/hns_roce_mr.c
+++ b/drivers/infiniband/hw/hns/hns_roce_mr.c
@@ -340,7 +340,6 @@ int hns_roce_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
{
struct hns_roce_dev *hr_dev = to_hr_dev(ibmr->device);
struct hns_roce_mr *mr = to_hr_mr(ibmr);
- int ret = 0;
if (hr_dev->hw->dereg_mr)
hr_dev->hw->dereg_mr(hr_dev);
@@ -348,7 +347,7 @@ int hns_roce_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
hns_roce_mr_free(hr_dev, mr);
kfree(mr);
- return ret;
+ return 0;
}
struct ib_mr *hns_roce_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type,
--
2.20.1
Powered by blists - more mailing lists