diff mbox

[-next,03/26] ata: Use dma_zalloc_coherent

Message ID 2be5da39b914e5f9d845c0f789267e80c188d5b5.1402863905.git.joe@perches.com
State Not Applicable
Delegated to: David Miller
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>
---
 drivers/ata/sata_fsl.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Tejun Heo June 17, 2014, 2:23 p.m. UTC | #1
On Sun, Jun 15, 2014 at 01:37:32PM -0700, Joe Perches wrote:
> Use the zeroing function instead of dma_alloc_coherent & memset(,0,)
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Applied to cgroup/for-3.17.

Thanks.
diff mbox

Patch

diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 616a6d2..07bc7e4 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -734,13 +734,12 @@  static int sata_fsl_port_start(struct ata_port *ap)
 	if (!pp)
 		return -ENOMEM;
 
-	mem = dma_alloc_coherent(dev, SATA_FSL_PORT_PRIV_DMA_SZ, &mem_dma,
-				 GFP_KERNEL);
+	mem = dma_zalloc_coherent(dev, SATA_FSL_PORT_PRIV_DMA_SZ, &mem_dma,
+				  GFP_KERNEL);
 	if (!mem) {
 		kfree(pp);
 		return -ENOMEM;
 	}
-	memset(mem, 0, SATA_FSL_PORT_PRIV_DMA_SZ);
 
 	pp->cmdslot = mem;
 	pp->cmdslot_paddr = mem_dma;