提交 94463a9c 编写于 作者: J Joe Perches 提交者: Tejun Heo

ata: Use dma_zalloc_coherent

Use the zeroing function instead of dma_alloc_coherent & memset(,0,)
Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NTejun Heo <tj@kernel.org>
上级 ebe06187
...@@ -734,13 +734,12 @@ static int sata_fsl_port_start(struct ata_port *ap) ...@@ -734,13 +734,12 @@ static int sata_fsl_port_start(struct ata_port *ap)
if (!pp) if (!pp)
return -ENOMEM; return -ENOMEM;
mem = dma_alloc_coherent(dev, SATA_FSL_PORT_PRIV_DMA_SZ, &mem_dma, mem = dma_zalloc_coherent(dev, SATA_FSL_PORT_PRIV_DMA_SZ, &mem_dma,
GFP_KERNEL); GFP_KERNEL);
if (!mem) { if (!mem) {
kfree(pp); kfree(pp);
return -ENOMEM; return -ENOMEM;
} }
memset(mem, 0, SATA_FSL_PORT_PRIV_DMA_SZ);
pp->cmdslot = mem; pp->cmdslot = mem;
pp->cmdslot_paddr = mem_dma; pp->cmdslot_paddr = mem_dma;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册