diff mbox

[-next,01/26] powerpc: Use dma_zalloc_coherent

Message ID ceb2b3214fbb7c5ea5e356d35df4d0b38b90a41a.1402863905.git.joe@perches.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Joe Perches June 15, 2014, 8:37 p.m. UTC
Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/powerpc/platforms/pasemi/dma_lib.c | 8 +++-----
 arch/powerpc/sysdev/fsl_rmu.c           | 9 ++++-----
 2 files changed, 7 insertions(+), 10 deletions(-)
diff mbox

Patch

diff --git a/arch/powerpc/platforms/pasemi/dma_lib.c b/arch/powerpc/platforms/pasemi/dma_lib.c
index aafa01ba..52b391f 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,
-					     ring_size * sizeof(u64),
-					     &chan->ring_dma, GFP_KERNEL);
+	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);
diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c
index b48197a..34b49fc 100644
--- a/arch/powerpc/sysdev/fsl_rmu.c
+++ b/arch/powerpc/sysdev/fsl_rmu.c
@@ -744,15 +744,14 @@  fsl_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
 	}
 
 	/* Initialize outbound message descriptor ring */
-	rmu->msg_tx_ring.virt = dma_alloc_coherent(priv->dev,
-				rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
-				&rmu->msg_tx_ring.phys, GFP_KERNEL);
+	rmu->msg_tx_ring.virt = dma_zalloc_coherent(priv->dev,
+						    rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE,
+						    &rmu->msg_tx_ring.phys,
+						    GFP_KERNEL);
 	if (!rmu->msg_tx_ring.virt) {
 		rc = -ENOMEM;
 		goto out_dma;
 	}
-	memset(rmu->msg_tx_ring.virt, 0,
-			rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE);
 	rmu->msg_tx_ring.tx_slot = 0;
 
 	/* Point dequeue/enqueue pointers at first entry in ring */