From: Thomas Meyer <thomas@m3y3r.de>
To: james.smart@broadcom.com, dick.kennedy@broadcom.com,
jejb@linux.vnet.ibm.com, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/6] scsi: lpfc: Cocci spatch "pool_zalloc-simple"
Date: Thu, 21 Sep 2017 08:15:26 +0200 [thread overview]
Message-ID: <1505974468535-735692655-3-diffsplit-thomas@m3y3r.de> (raw)
In-Reply-To: <1505974468535-2047238743-0-diffsplit-thomas@m3y3r.de>
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: Thomas Meyer <thomas@m3y3r.de>
---
diff -u -p a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
--- a/drivers/scsi/lpfc/lpfc_nvme.c
+++ b/drivers/scsi/lpfc/lpfc_nvme.c
@@ -1938,14 +1938,13 @@ lpfc_new_nvme_buf(struct lpfc_vport *vpo
* 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);
lxri = lpfc_sli4_next_xritag(phba);
if (lxri == NO_XRI) {
next prev parent reply other threads:[~2017-09-21 6:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-21 6:15 [PATCH 0/6] Cocci spatch "pool_zalloc-simple" - v4.14-rc1 Thomas Meyer
2017-09-21 6:15 ` [PATCH 2/6] e100: Cocci spatch "pool_zalloc-simple" Thomas Meyer
2017-09-21 6:15 ` [PATCH 4/6] mvsas: " Thomas Meyer
2017-09-21 6:15 ` Thomas Meyer [this message]
2017-09-22 15:27 ` [PATCH 3/6] scsi: lpfc: " James Smart
2017-09-25 23:06 ` Martin K. Petersen
2017-09-21 6:15 ` [PATCH 1/6] mailbox: bcm-flexrm-mailbox: " Thomas Meyer
2017-09-21 6:15 ` [PATCH 5/6] scsi: qla2xxx: " Thomas Meyer
2017-09-22 17:25 ` Madhani, Himanshu
2017-09-25 23:07 ` Martin K. Petersen
2017-09-21 6:15 ` [PATCH 6/6] scsi: " Thomas Meyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1505974468535-735692655-3-diffsplit-thomas@m3y3r.de \
--to=thomas@m3y3r.de \
--cc=dick.kennedy@broadcom.com \
--cc=james.smart@broadcom.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®