aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c
diff options
context:
space:
mode:
authorBryan Tan <bryantan@vmware.com>2017-12-20 11:27:00 -0800
committerJason Gunthorpe <jgg@mellanox.com>2017-12-27 21:37:26 -0700
commita61eb6136829173d51dd0c7f7248733025708eeb (patch)
treeed34c4ae294ab88718d81f973f1b5b66712ec59a /drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c
parentRDMA/vmw_pvrdma: Use more specific sizeof in kcalloc (diff)
downloadlinux-dev-a61eb6136829173d51dd0c7f7248733025708eeb.tar.xz
linux-dev-a61eb6136829173d51dd0c7f7248733025708eeb.zip
RDMA/vmw_pvrdma: Use refcount_t instead of atomic_t
refcount_t is the preferred type for refcounts. Change the QP and CQ refcnt fields to use refcount_t. Reviewed-by: Adit Ranadive <aditr@vmware.com> Reviewed-by: Aditya Sarwade <asarwade@vmware.com> Reviewed-by: Jorgen Hansen <jhansen@vmware.com> Signed-off-by: Bryan Tan <bryantan@vmware.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c')
-rw-r--r--drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c
index cc4616124983..faa9478c14a6 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c
@@ -177,7 +177,7 @@ struct ib_cq *pvrdma_create_cq(struct ib_device *ibdev,
else
pvrdma_page_dir_insert_umem(&cq->pdir, cq->umem, 0);
- atomic_set(&cq->refcnt, 1);
+ refcount_set(&cq->refcnt, 1);
init_completion(&cq->free);
spin_lock_init(&cq->cq_lock);
@@ -229,7 +229,7 @@ err_cq:
static void pvrdma_free_cq(struct pvrdma_dev *dev, struct pvrdma_cq *cq)
{
- if (atomic_dec_and_test(&cq->refcnt))
+ if (refcount_dec_and_test(&cq->refcnt))
complete(&cq->free);
wait_for_completion(&cq->free);