lkml.org 
[lkml]   [2018]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] arch/powerpc: Use dma_zalloc_coherent
On Mon, Nov 5, 2018 at 8:58 AM Sabyasachi Gupta
<sabyasachi.linux@gmail.com> wrote:
>
> Replaced dma_alloc_coherent + memset with dma_zalloc_coherent
>
> Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>

Any comment on this patch?

> ---
> arch/powerpc/platforms/pasemi/dma_lib.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pasemi/dma_lib.c b/arch/powerpc/platforms/pasemi/dma_lib.c
> index 53384eb..d18d164 100644
> --- a/arch/powerpc/platforms/pasemi/dma_lib.c
> +++ b/arch/powerpc/platforms/pasemi/dma_lib.c
> @@ -255,15 +255,13 @@ int pasemi_dma_alloc_ring(struct pasemi_dmachan *chan, int ring_size)
>
> chan->ring_size = ring_size;
>
> - chan->ring_virt = dma_alloc_coherent(&dma_pdev->dev,
> + chan->ring_virt = dma_zalloc_coherent(&dma_pdev->dev,
> ring_size * sizeof(u64),
> &chan->ring_dma, GFP_KERNEL);
>
> if (!chan->ring_virt)
> return -ENOMEM;
>
> - memset(chan->ring_virt, 0, ring_size * sizeof(u64));
> -
> return 0;
> }
> EXPORT_SYMBOL(pasemi_dma_alloc_ring);
> --
> 2.7.4
>

\
 
 \ /
  Last update: 2018-11-15 19:00    [W:0.141 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site