]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
bfa: Use dma_zalloc_coherent
authorJoe Perches <joe@perches.com>
Sun, 15 Jun 2014 20:37:44 +0000 (13:37 -0700)
committerChristoph Hellwig <hch@lst.de>
Fri, 25 Jul 2014 21:16:54 +0000 (17:16 -0400)
Use the zeroing function instead of dma_alloc_coherent & memset(,0,)

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/bfa/bfad_bsg.c

index 8994fb857ee9e6693a1d01e4998cf1b4e544004e..65f3e74819fcdab04a354af12f2d439a76e452c7 100644 (file)
@@ -3270,13 +3270,13 @@ bfad_fcxp_map_sg(struct bfad_s *bfad, void *payload_kbuf,
        /* Allocate dma coherent memory */
        buf_info = buf_base;
        buf_info->size = payload_len;
-       buf_info->virt = dma_alloc_coherent(&bfad->pcidev->dev, buf_info->size,
-                                       &buf_info->phys, GFP_KERNEL);
+       buf_info->virt = dma_zalloc_coherent(&bfad->pcidev->dev,
+                                            buf_info->size, &buf_info->phys,
+                                            GFP_KERNEL);
        if (!buf_info->virt)
                goto out_free_mem;
 
        /* copy the linear bsg buffer to buf_info */
-       memset(buf_info->virt, 0, buf_info->size);
        memcpy(buf_info->virt, payload_kbuf, buf_info->size);
 
        /*