summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qedr
diff options
context:
space:
mode:
authorHimanshu Jha <himanshujha199640@gmail.com>2017-12-31 13:31:03 +0100
committerJason Gunthorpe <jgg@mellanox.com>2018-01-02 19:20:13 +0100
commit7bced914e80ac23978a3eb6ba00a3338e7fce087 (patch)
tree072b42a7de361c4e9339cd0817b0ff4df579b86a /drivers/infiniband/hw/qedr
parentRDMA/vmw_pvrdma: Use zeroing memory allocator than allocator/memset (diff)
downloadlinux-7bced914e80ac23978a3eb6ba00a3338e7fce087.tar.xz
linux-7bced914e80ac23978a3eb6ba00a3338e7fce087.zip
RDMA/qedr: Use zeroing memory allocator than allocator/memset
Use dma_zalloc_coherent for allocating zeroed memory and remove unnecessary memset function. Done using Coccinelle. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci 0-day tested with no failures. Suggested-by: Luis R. Rodriguez <mcgrof@kernel.org> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Acked-by: Ram Amrani <Ram.Amrani@cavium.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/qedr')
-rw-r--r--drivers/infiniband/hw/qedr/verbs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c
index b26aa88dab48..3b9c89848d66 100644
--- a/drivers/infiniband/hw/qedr/verbs.c
+++ b/drivers/infiniband/hw/qedr/verbs.c
@@ -604,12 +604,11 @@ static struct qedr_pbl *qedr_alloc_pbl_tbl(struct qedr_dev *dev,
return ERR_PTR(-ENOMEM);
for (i = 0; i < pbl_info->num_pbls; i++) {
- va = dma_alloc_coherent(&pdev->dev, pbl_info->pbl_size,
- &pa, flags);
+ va = dma_zalloc_coherent(&pdev->dev, pbl_info->pbl_size,
+ &pa, flags);
if (!va)
goto err;
- memset(va, 0, pbl_info->pbl_size);
pbl_table[i].va = va;
pbl_table[i].pa = pa;
}