diff options
author | Doug Ledford <dledford@redhat.com> | 2017-04-25 14:00:59 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-04-25 14:00:59 -0400 |
commit | 374cb8610ac15737acb65ca0293c21dc2205662b (patch) | |
tree | 46a68d33d152c739fcd6a000e88b4794a601a21d /drivers/infiniband/hw/bnxt_re/ib_verbs.c | |
parent | ebbd1dfb2620fb95e1d850286c80068766222276 (diff) | |
download | lwn-374cb8610ac15737acb65ca0293c21dc2205662b.tar.gz lwn-374cb8610ac15737acb65ca0293c21dc2205662b.zip |
RDMA/bnxt_re: Use IS_ERR_OR_NULL where appropriate
Constructs such as if (ptr && !IS_ERR(ptr)) can be shorted to
just !IS_ERR_OR_NULL(ptr) instead. Make substitutions in the bnxt_re
driver where appropriate.
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/bnxt_re/ib_verbs.c')
-rw-r--r-- | drivers/infiniband/hw/bnxt_re/ib_verbs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index 17aa087cdb6f..177411469686 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -692,9 +692,9 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp) kfree(rdev->qp1_sqp); } - if (qp->rumem && !IS_ERR(qp->rumem)) + if (!IS_ERR_OR_NULL(qp->rumem)) ib_umem_release(qp->rumem); - if (qp->sumem && !IS_ERR(qp->sumem)) + if (!IS_ERR_OR_NULL(qp->sumem)) ib_umem_release(qp->sumem); mutex_lock(&rdev->qp_lock); @@ -2116,7 +2116,7 @@ int bnxt_re_destroy_cq(struct ib_cq *ib_cq) dev_err(rdev_to_dev(rdev), "Failed to destroy HW CQ"); return rc; } - if (cq->umem && !IS_ERR(cq->umem)) + if (!IS_ERR_OR_NULL(cq->umem)) ib_umem_release(cq->umem); if (cq) { @@ -2829,7 +2829,7 @@ int bnxt_re_dereg_mr(struct ib_mr *ib_mr) } rc = bnxt_qplib_free_mrw(&rdev->qplib_res, &mr->qplib_mr); - if (!IS_ERR(mr->ib_umem) && mr->ib_umem) + if (!IS_ERR_OR_NULL(mr->ib_umem)) ib_umem_release(mr->ib_umem); kfree(mr); |