Skip to contentSkip to conversation

arch/powerpc: Use dma_zalloc_coherent

PATCH In review Sabyasachi Gupta 2 participants 4 messages Nov 5, 2018 – Dec 22, 2018 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/powerpc: Use dma_zalloc_coherent

Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

---
 arch/powerpc/sysdev/fsl_rmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/powerpc/sysdev/fsl_rmu.c +1 -3
index 88b35a3d..8b0ebf3 100644
@@ -756,15 +756,13 @@ 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.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 */
Signature · 1 line
2.7.4
#1 lore raw
Quoted 4 lines · Sabyasachi Gupta

Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

Any comment on this patch?

Quoted 28 lines
---
 arch/powerpc/sysdev/fsl_rmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/powerpc/sysdev/fsl_rmu.c +1 -4
index 88b35a3d..8b0ebf3 100644
@@ -756,15 +756,13 @@ 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.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 */
--

2.7.4

#2 lore raw
Quoted 8 lines · Sabyasachi Gupta
Quoted 4 lines · Sabyasachi Gupta

Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

Any comment on this patch?

Just that FSL patches should be CCed to me, and the subject line is too broad (and duplicates another patch posted around the same time).

I'm applying with the subject changed to
"arch/powerpc/fsl_rmu: Use dma_zalloc_coherent".

-Scott

#3 lore raw
In reply to Sabyasachi Gupta
Quoted 4 lines · Sabyasachi Gupta

Replaced dma_alloc_coherent + memset with dma_zalloc_coherent

Any comment on this patch?

Quoted 28 lines
---
 arch/powerpc/sysdev/fsl_rmu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/powerpc/sysdev/fsl_rmu.c +1 -4
index 88b35a3d..8b0ebf3 100644
@@ -756,15 +756,13 @@ 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.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 */
--

2.7.4