Skip to content

Commit

Permalink
RDMA/hns: Remove unnecessary ret variable from hns_roce_dereg_mr()
Browse files Browse the repository at this point in the history
Fix the following coccicheck warning:

drivers/infiniband/hw/hns/hns_roce_mr.c:343:5-8: Unneeded variable: "ret".

Return 0 directly instead.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guo Zhengkui <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
  • Loading branch information
Guo Zhengkui authored and jgunthorpe committed May 5, 2022
1 parent e773415 commit cc377b9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/infiniband/hw/hns/hns_roce_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,14 @@ 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);

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,
Expand Down

0 comments on commit cc377b9

Please sign in to comment.