linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] infiniband/hw/hns/hns_roce_hw_v2.c: Use dma_zalloc_coherent
@ 2018-11-09 14:38 Sabyasachi Gupta
  2018-11-10  6:27 ` Souptick Joarder
  0 siblings, 1 reply; 3+ messages in thread
From: Sabyasachi Gupta @ 2018-11-09 14:38 UTC (permalink / raw)
  To: oulijun, xavier.huwei, dledford, jgg
  Cc: jrdr.linux, linux-rdma, linux-kernel, brajeswar.linux

Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

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

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index a4c62ae..c9966ec 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -4972,13 +4972,12 @@ static int hns_roce_mhop_alloc_eq(struct hns_roce_dev *hr_dev,
 				eqe_alloc = i * (buf_chk_sz / eq->eqe_size);
 				size = (eq->entries - eqe_alloc) * eq->eqe_size;
 			}
-			eq->buf[i] = dma_alloc_coherent(dev, size,
+			eq->buf[i] = dma_zalloc_coherent(dev, size,
 							&(eq->buf_dma[i]),
 							GFP_KERNEL);
 			if (!eq->buf[i])
 				goto err_dma_alloc_buf;
 
-			memset(eq->buf[i], 0, size);
 			*(eq->bt_l0 + i) = eq->buf_dma[i];
 
 			eq_buf_cnt++;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] infiniband/hw/hns/hns_roce_hw_v2.c: Use dma_zalloc_coherent
  2018-11-09 14:38 [PATCH] infiniband/hw/hns/hns_roce_hw_v2.c: Use dma_zalloc_coherent Sabyasachi Gupta
@ 2018-11-10  6:27 ` Souptick Joarder
  2018-11-12 12:04   ` Sabyasachi Gupta
  0 siblings, 1 reply; 3+ messages in thread
From: Souptick Joarder @ 2018-11-10  6:27 UTC (permalink / raw)
  To: Sabyasachi Gupta
  Cc: oulijun, xavier.huwei, Doug Ledford, jgg, linux-rdma,
	linux-kernel, Brajeswar Ghosh

On Fri, Nov 9, 2018 at 8:08 PM Sabyasachi Gupta
<sabyasachi.linux@gmail.com> wrote:
>
> Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

There are few other places in this file where same is applicable.
Can we get those changes in same patch ?
>
> Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> index a4c62ae..c9966ec 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> @@ -4972,13 +4972,12 @@ static int hns_roce_mhop_alloc_eq(struct hns_roce_dev *hr_dev,
>                                 eqe_alloc = i * (buf_chk_sz / eq->eqe_size);
>                                 size = (eq->entries - eqe_alloc) * eq->eqe_size;
>                         }
> -                       eq->buf[i] = dma_alloc_coherent(dev, size,
> +                       eq->buf[i] = dma_zalloc_coherent(dev, size,
>                                                         &(eq->buf_dma[i]),
>                                                         GFP_KERNEL);
>                         if (!eq->buf[i])
>                                 goto err_dma_alloc_buf;
>
> -                       memset(eq->buf[i], 0, size);
>                         *(eq->bt_l0 + i) = eq->buf_dma[i];
>
>                         eq_buf_cnt++;
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] infiniband/hw/hns/hns_roce_hw_v2.c: Use dma_zalloc_coherent
  2018-11-10  6:27 ` Souptick Joarder
@ 2018-11-12 12:04   ` Sabyasachi Gupta
  0 siblings, 0 replies; 3+ messages in thread
From: Sabyasachi Gupta @ 2018-11-12 12:04 UTC (permalink / raw)
  To: Souptick Joarder
  Cc: oulijun, xavier.huwei, dledford, jgg, linux-rdma, linux-kernel,
	Brajeswar Ghosh

On Sat, Nov 10, 2018 at 11:57 AM Souptick Joarder <jrdr.linux@gmail.com> wrote:
>
> On Fri, Nov 9, 2018 at 8:08 PM Sabyasachi Gupta
> <sabyasachi.linux@gmail.com> wrote:
> >
> > Replaced dma_alloc_coherent + memset with dma_zalloc_coherent
>
> There are few other places in this file where same is applicable.
> Can we get those changes in same patch ?
> >
as all the changes are now in linux-next I am going to drop this patch

> > Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
> > ---
> >  drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> > index a4c62ae..c9966ec 100644
> > --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> > @@ -4972,13 +4972,12 @@ static int hns_roce_mhop_alloc_eq(struct hns_roce_dev *hr_dev,
> >                                 eqe_alloc = i * (buf_chk_sz / eq->eqe_size);
> >                                 size = (eq->entries - eqe_alloc) * eq->eqe_size;
> >                         }
> > -                       eq->buf[i] = dma_alloc_coherent(dev, size,
> > +                       eq->buf[i] = dma_zalloc_coherent(dev, size,
> >                                                         &(eq->buf_dma[i]),
> >                                                         GFP_KERNEL);
> >                         if (!eq->buf[i])
> >                                 goto err_dma_alloc_buf;
> >
> > -                       memset(eq->buf[i], 0, size);
> >                         *(eq->bt_l0 + i) = eq->buf_dma[i];
> >
> >                         eq_buf_cnt++;
> > --
> > 2.7.4
> >

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-12 12:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-09 14:38 [PATCH] infiniband/hw/hns/hns_roce_hw_v2.c: Use dma_zalloc_coherent Sabyasachi Gupta
2018-11-10  6:27 ` Souptick Joarder
2018-11-12 12:04   ` Sabyasachi Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).