ata: sata_mv: Replacing dma_pool_alloc and memset with a single call dma_pool_zalloc.
authorHarman Kalra <harman4linux@gmail.com>
Tue, 20 Sep 2016 19:44:40 +0000 (01:14 +0530)
committerTejun Heo <tj@kernel.org>
Tue, 20 Sep 2016 20:07:16 +0000 (16:07 -0400)
Replacing dma_pool_alloc and memset with a single call to dma_pool_zalloc

Signed-off-by: Harman Kalra <harman4linux@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/sata_mv.c

index 745489a1c86ab2c11701b124f8998126608c398a..efc48bf89d5182a6b4b4150b522fabc2cc1844ee 100644 (file)
@@ -1727,15 +1727,13 @@ static int mv_port_start(struct ata_port *ap)
                return -ENOMEM;
        ap->private_data = pp;
 
-       pp->crqb = dma_pool_alloc(hpriv->crqb_pool, GFP_KERNEL, &pp->crqb_dma);
+       pp->crqb = dma_pool_zalloc(hpriv->crqb_pool, GFP_KERNEL, &pp->crqb_dma);
        if (!pp->crqb)
                return -ENOMEM;
-       memset(pp->crqb, 0, MV_CRQB_Q_SZ);
 
-       pp->crpb = dma_pool_alloc(hpriv->crpb_pool, GFP_KERNEL, &pp->crpb_dma);
+       pp->crpb = dma_pool_zalloc(hpriv->crpb_pool, GFP_KERNEL, &pp->crpb_dma);
        if (!pp->crpb)
                goto out_port_free_dma_mem;
-       memset(pp->crpb, 0, MV_CRPB_Q_SZ);
 
        /* 6041/6081 Rev. "C0" (and newer) are okay with async notify */
        if (hpriv->hp_flags & MV_HP_ERRATA_60X1C0)