Commit df2f7729 authored by Thomas Meyer's avatar Thomas Meyer Committed by Martin K. Petersen

scsi: lpfc: Cocci spatch "pool_zalloc-simple"

Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0.
Found by coccinelle spatch "api/alloc/pool_zalloc-simple.cocci"
Signed-off-by: default avatarThomas Meyer <thomas@m3y3r.de>
Acked-by: default avatarJames Smart <james.smart@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 2930f817
...@@ -1938,14 +1938,13 @@ lpfc_new_nvme_buf(struct lpfc_vport *vport, int num_to_alloc) ...@@ -1938,14 +1938,13 @@ lpfc_new_nvme_buf(struct lpfc_vport *vport, int num_to_alloc)
* pci bus space for an I/O. The DMA buffer includes the * pci bus space for an I/O. The DMA buffer includes the
* number of SGE's necessary to support the sg_tablesize. * number of SGE's necessary to support the sg_tablesize.
*/ */
lpfc_ncmd->data = dma_pool_alloc(phba->lpfc_sg_dma_buf_pool, lpfc_ncmd->data = dma_pool_zalloc(phba->lpfc_sg_dma_buf_pool,
GFP_KERNEL, GFP_KERNEL,
&lpfc_ncmd->dma_handle); &lpfc_ncmd->dma_handle);
if (!lpfc_ncmd->data) { if (!lpfc_ncmd->data) {
kfree(lpfc_ncmd); kfree(lpfc_ncmd);
break; break;
} }
memset(lpfc_ncmd->data, 0, phba->cfg_sg_dma_buf_size);
lxri = lpfc_sli4_next_xritag(phba); lxri = lpfc_sli4_next_xritag(phba);
if (lxri == NO_XRI) { if (lxri == NO_XRI) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment