linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] RDMA/hns: fix returnvar.cocci warning
@ 2022-04-26  7:08 Guo Zhengkui
  2022-05-04 23:57 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Guo Zhengkui @ 2022-04-26  7:08 UTC (permalink / raw)
  To: Wenpeng Liang, Weihang Li, Jason Gunthorpe, Leon Romanovsky,
	open list:HISILICON ROCE DRIVER, open list
  Cc: zhengkui_guo, Guo Zhengkui

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@vivo.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH linux-next] RDMA/hns: fix returnvar.cocci warning
  2022-04-26  7:08 [PATCH linux-next] RDMA/hns: fix returnvar.cocci warning Guo Zhengkui
@ 2022-05-04 23:57 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2022-05-04 23:57 UTC (permalink / raw)
  To: Guo Zhengkui
  Cc: Wenpeng Liang, Weihang Li, Leon Romanovsky,
	open list:HISILICON ROCE DRIVER, open list, zhengkui_guo

On Tue, Apr 26, 2022 at 03:08:58PM +0800, Guo Zhengkui wrote:
> 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@vivo.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_mr.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-05  0:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26  7:08 [PATCH linux-next] RDMA/hns: fix returnvar.cocci warning Guo Zhengkui
2022-05-04 23:57 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).