[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN3PR07MB25781C0289D6C5D55B712BD3F81B0@BN3PR07MB2578.namprd07.prod.outlook.com>
Date: Sun, 31 Dec 2017 13:09:42 +0000
From: "Amrani, Ram" <Ram.Amrani@...ium.com>
To: Himanshu Jha <himanshujha199640@...il.com>,
"dledford@...hat.com" <dledford@...hat.com>
CC: "Kalderon, Michal" <Michal.Kalderon@...ium.com>,
"Elior, Ariel" <Ariel.Elior@...ium.com>,
"jgg@...pe.ca" <jgg@...pe.ca>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] 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@...nel.org>
> Signed-off-by: Himanshu Jha <himanshujha199640@...il.com>
> ---
> drivers/infiniband/hw/qedr/verbs.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c
> index b26aa88..3b9c898 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;
> }
> --
> 2.7.4
Acked-by: Ram Amrani <Ram.Amrani@...ium.com>
Thanks,
Ram
Powered by blists - more mailing lists