diff mbox series

scsi: lpfc: Use *_pool_zalloc rather than *_pool_alloc

Message ID 1559161113901-1017843021-1-diffsplit-thomas@m3y3r.de (mailing list archive)
State Mainlined
Commit a5c990eea5ddd587bcd9af6dc973a1653c8d94af
Headers show
Series scsi: lpfc: Use *_pool_zalloc rather than *_pool_alloc | expand

Commit Message

Thomas Meyer May 29, 2019, 8:21 p.m. UTC
Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

Comments

James Smart May 30, 2019, 12:23 a.m. UTC | #1
On 5/29/2019 1:21 PM, Thomas Meyer wrote:
> Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0.
>
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
> ---
>
>

looks good

Reviewed-by: James Smart <james.smart@broadcom.com>

-- james
Martin K. Petersen May 30, 2019, 2:06 a.m. UTC | #2
Thomas,

> Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0.

Applied to 5.3/scsi-queue. Thanks!
diff mbox series

Patch

diff -u -p a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -4114,14 +4114,13 @@  lpfc_new_io_buf(struct lpfc_hba *phba, i
 		 * pci bus space for an I/O. The DMA buffer includes the
 		 * number of SGE's necessary to support the sg_tablesize.
 		 */
-		lpfc_ncmd->data = dma_pool_alloc(phba->lpfc_sg_dma_buf_pool,
-				GFP_KERNEL,
-				&lpfc_ncmd->dma_handle);
+		lpfc_ncmd->data = dma_pool_zalloc(phba->lpfc_sg_dma_buf_pool,
+						  GFP_KERNEL,
+						  &lpfc_ncmd->dma_handle);
 		if (!lpfc_ncmd->data) {
 			kfree(lpfc_ncmd);
 			break;
 		}
-		memset(lpfc_ncmd->data, 0, phba->cfg_sg_dma_buf_size);
 
 		/*
 		 * 4K Page alignment is CRITICAL to BlockGuard, double check