[PATCH] rdma/cxgb4: fix zalloc-simple.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Fengguang Wu <fengguang.wu@xxxxxxxxx>

 Use zeroing allocator rather than allocator followed by memset with 0

Generated by: scripts/coccinelle/api/alloc/zalloc-simple.cocci

CC: Raju Rangoju <rajur@xxxxxxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
Signed-off-by: Julia Lawall <julia.lawall@xxxxxxx>

---

url:
https://github.com/0day-ci/linux/commits/Raju-Rangoju/rdma-cxgb4-Add-SRQ-support-for-Chelsio-adapters/20180313-062514
:::::: branch date: 7 days ago
:::::: commit date: 7 days ago

 qp.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -2377,13 +2377,11 @@ static int alloc_srq_queue(struct c4iw_s
 	wq->rqt_abs_idx = (wq->rqt_hwaddr - rdev->lldi.vr->rq.start) >>
 		T4_RQT_ENTRY_SHIFT;

-	wq->queue = dma_alloc_coherent(&(rdev->lldi.pdev->dev),
-			wq->memsize, &(wq->dma_addr),
-			GFP_KERNEL);
+	wq->queue = dma_zalloc_coherent(&(rdev->lldi.pdev->dev), wq->memsize,
+					&(wq->dma_addr), GFP_KERNEL);
 	if (!wq->queue)
 		goto err_free_rqtpool;

-	memset(wq->queue, 0, wq->memsize);
 	pci_unmap_addr_set(wq, mapping, wq->dma_addr);

 	wq->bar2_va = c4iw_bar2_addrs(rdev, wq->qid, T4_BAR2_QTYPE_EGRESS,
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux