scsi: lpfc: Use dma_zalloc_coherent
authorSabyasachi Gupta <sabyasachi.linux@gmail.com>
Sun, 18 Nov 2018 14:38:48 +0000 (20:08 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 22 Nov 2018 03:31:22 +0000 (22:31 -0500)
Replaced dma_alloc_coherent + memset with dma_zalloc_coherent.

Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_sli.c

index 0e97f64..3912a2d 100644 (file)
@@ -6229,7 +6229,7 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba *phba,
                        goto free_mem;
                }
 
-               dmabuf->virt = dma_alloc_coherent(&phba->pcidev->dev,
+               dmabuf->virt = dma_zalloc_coherent(&phba->pcidev->dev,
                                                  LPFC_RAS_MAX_ENTRY_SIZE,
                                                  &dmabuf->phys,
                                                  GFP_KERNEL);
@@ -6240,7 +6240,6 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba *phba,
                                        "6187 DMA Alloc Failed FW logging");
                        goto free_mem;
                }
-               memset(dmabuf->virt, 0, LPFC_RAS_MAX_ENTRY_SIZE);
                dmabuf->buffer_tag = i;
                list_add_tail(&dmabuf->list, &ras_fwlog->fwlog_buff_list);
        }