diff mbox

scsi: lpfc: Replace pci_pool_alloc by pci_pool_zalloc

Message ID 20161128095237.GA30900@gnr743-HP-ZBook-15 (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Souptick Joarder Nov. 28, 2016, 9:52 a.m. UTC
In lpfc_new_scsi_buf_s3() and lpfc_new_scsi_buf_s4() pci_pool_alloc
followed by memset will be replaced by pci_pool_zalloc()

Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
---
 drivers/scsi/lpfc/lpfc_scsi.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Johannes Thumshirn Nov. 28, 2016, 10:21 a.m. UTC | #1
On Mon, Nov 28, 2016 at 03:22:37PM +0530, Souptick Joarder wrote:
> In lpfc_new_scsi_buf_s3() and lpfc_new_scsi_buf_s4() pci_pool_alloc
> followed by memset will be replaced by pci_pool_zalloc()
> 
> Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
> ---

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Martin K. Petersen Nov. 29, 2016, 4:59 p.m. UTC | #2
>>>>> "Souptick" == Souptick Joarder <jrdr.linux@gmail.com> writes:

Souptick> In lpfc_new_scsi_buf_s3() and lpfc_new_scsi_buf_s4()
Souptick> pci_pool_alloc followed by memset will be replaced by
Souptick> pci_pool_zalloc()

James, Dick: Please review!
Martin K. Petersen Nov. 30, 2016, 4:41 p.m. UTC | #3
>>>>> "Souptick" == Souptick Joarder <jrdr.linux@gmail.com> writes:

Souptick> In lpfc_new_scsi_buf_s3() and lpfc_new_scsi_buf_s4()
Souptick> pci_pool_alloc followed by memset will be replaced by
Souptick> pci_pool_zalloc()

Applied to 4.10/scsi-queue.
diff mbox

Patch

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index d197aa1..58851c7 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -413,15 +413,13 @@  struct scsi_dif_tuple {
 		 * struct fcp_cmnd, struct fcp_rsp and the number of bde's
 		 * necessary to support the sg_tablesize.
 		 */
-		psb->data = pci_pool_alloc(phba->lpfc_scsi_dma_buf_pool,
+		psb->data = pci_pool_zalloc(phba->lpfc_scsi_dma_buf_pool,
 					GFP_KERNEL, &psb->dma_handle);
 		if (!psb->data) {
 			kfree(psb);
 			break;
 		}
 
-		/* Initialize virtual ptrs to dma_buf region. */
-		memset(psb->data, 0, phba->cfg_sg_dma_buf_size);
 
 		/* Allocate iotag for psb->cur_iocbq. */
 		iotag = lpfc_sli_next_iotag(phba, &psb->cur_iocbq);
@@ -821,13 +819,12 @@  struct scsi_dif_tuple {
 		 * for the struct fcp_cmnd, struct fcp_rsp and the number
 		 * of bde's necessary to support the sg_tablesize.
 		 */
-		psb->data = pci_pool_alloc(phba->lpfc_scsi_dma_buf_pool,
+		psb->data = pci_pool_zalloc(phba->lpfc_scsi_dma_buf_pool,
 						GFP_KERNEL, &psb->dma_handle);
 		if (!psb->data) {
 			kfree(psb);
 			break;
 		}
-		memset(psb->data, 0, phba->cfg_sg_dma_buf_size);
 
 		/*
 		 * 4K Page alignment is CRITICAL to BlockGuard, double check