diff mbox series

infiniband/hw/cxgb4/qp.c: Use dma_zalloc_coherent

Message ID 5be99a9e.1c69fb81.87c65.4ec2@mx.google.com (mailing list archive)
State Accepted
Commit 2b91fdfd13f5d3c3a5800731b4c46b0b5d69feaf
Delegated to: Jason Gunthorpe
Headers show
Series infiniband/hw/cxgb4/qp.c: Use dma_zalloc_coherent | expand

Commit Message

Sabyasachi Gupta Nov. 12, 2018, 3:21 p.m. UTC
Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
---
 drivers/infiniband/hw/cxgb4/qp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Steve Wise Nov. 12, 2018, 3:31 p.m. UTC | #1
On 11/12/2018 9:21 AM, Sabyasachi Gupta wrote:
> Replaced dma_alloc_coherent + memset with dma_zalloc_coherent
> 
> Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
> ---
>  drivers/infiniband/hw/cxgb4/qp.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
> index 13478f3..5a8030b 100644
> --- a/drivers/infiniband/hw/cxgb4/qp.c
> +++ b/drivers/infiniband/hw/cxgb4/qp.c
> @@ -2564,13 +2564,12 @@ static int alloc_srq_queue(struct c4iw_srq *srq, struct c4iw_dev_ucontext *uctx,
>  	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->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);
>  	dma_unmap_addr_set(wq, mapping, wq->dma_addr);
>  
>  	wq->bar2_va = c4iw_bar2_addrs(rdev, wq->qid, CXGB4_BAR2_QTYPE_EGRESS,
> 

Acked-by: Steve Wise <swise@opengridcomputing.com>
Jason Gunthorpe Nov. 21, 2018, 10:59 p.m. UTC | #2
On Mon, Nov 12, 2018 at 08:51:59PM +0530, Sabyasachi Gupta wrote:
> Replaced dma_alloc_coherent + memset with dma_zalloc_coherent
> 
> Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
> Acked-by: Steve Wise <swise@opengridcomputing.com>
> ---
>  drivers/infiniband/hw/cxgb4/qp.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied to for-next

Thanks,
Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index 13478f3..5a8030b 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -2564,13 +2564,12 @@  static int alloc_srq_queue(struct c4iw_srq *srq, struct c4iw_dev_ucontext *uctx,
 	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->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);
 	dma_unmap_addr_set(wq, mapping, wq->dma_addr);
 
 	wq->bar2_va = c4iw_bar2_addrs(rdev, wq->qid, CXGB4_BAR2_QTYPE_EGRESS,