linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arch/powerpc: Use dma_zalloc_coherent
@ 2018-11-05  3:28 Sabyasachi Gupta
  2018-11-15 17:59 ` Sabyasachi Gupta
  2018-11-27  9:22 ` Michael Ellerman
  0 siblings, 2 replies; 7+ messages in thread
From: Sabyasachi Gupta @ 2018-11-05  3:28 UTC (permalink / raw)
  To: benh, paulus, mpe, joe, darren, christophe.leroy, geoff
  Cc: linuxppc-dev, jrdr.linux, linux-kernel

Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
---
 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


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

end of thread, other threads:[~2018-11-27  9:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-05  3:28 [PATCH] arch/powerpc: Use dma_zalloc_coherent Sabyasachi Gupta
2018-11-15 17:59 ` Sabyasachi Gupta
2018-11-15 19:25   ` Joe Perches
2018-11-17  7:10     ` Souptick Joarder
2018-11-17  8:24       ` Joe Perches
2018-11-16 10:06   ` Michael Ellerman
2018-11-27  9:22 ` Michael Ellerman

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).