From patchwork Mon Nov 28 09:52:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 9449267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B56D6071C for ; Mon, 28 Nov 2016 09:52:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AB352574A for ; Mon, 28 Nov 2016 09:52:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DAD726419; Mon, 28 Nov 2016 09:52:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4207E2574A for ; Mon, 28 Nov 2016 09:52:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932340AbcK1Jwm (ORCPT ); Mon, 28 Nov 2016 04:52:42 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35987 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753329AbcK1Jwl (ORCPT ); Mon, 28 Nov 2016 04:52:41 -0500 Received: by mail-pg0-f68.google.com with SMTP id x23so12710211pgx.3 for ; Mon, 28 Nov 2016 01:52:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=Xo/zj9C+Shl1XrV6q+coZTuwlMbt3m5aqQkrltRyRlg=; b=dLDpHSgrfsICrZjtAkrMJ5MshlO7U/ipLlr/UDQGjVPAdTmHWo6O2DvbopVFWOATpH YVcoOv1AkLbmXQnDQSCsNUJETtq1mYeUQt239zGZs5mnAosx089HgqpGKf0dXzJzm9Xm 4mSvHWbMK4f0FA4d5FlyiVqZLq3YhrETokpiMSeSRIjDlkPv044MOaXb+jMmbm6Mshjj SPZ+Aq2/fAg3wK7bNoKzc6W56aylNIKbfBg0CrEPaPDp3RUKZ8TO5nwPJd5fsHWtkQuw miwa8aAzqhnjVSfIbYGUo1k8P4xIjRRiUhOXLQTPiuPslYRA4AiIZD4QSNnju5K0E+g2 5RFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=Xo/zj9C+Shl1XrV6q+coZTuwlMbt3m5aqQkrltRyRlg=; b=jONYt/UwNkyJqQXxKROkY1oG0N1JWIo5aF6otkRy5sZFvASGlbLv139GnP0KIGDCwq EVIYdTSE7THQbi5VzyNOJEKr0iJwmQRdRjbXDmjU+VkFdW9nRJeruBJXpIJGcAOmclI3 FDyN6ZLCxeF+qEvLhZl4BSp2ZXmJMhX7LYgDbh7fiipp0MZ8zMjVkyJlJXNekytqysIP XWL0oyiRYM383/oFw6ZARkY6LHKSfinkKOHOYWW2jierQhLRR6HmE14TqWhrBZLJggsn 4lxwPjD/5HfATl0KJsNvx6LlGWkNhGg1aCT9L3XKyH+GQYxGoHKPBpMk8f8cZQP789rk MKWg== X-Gm-Message-State: AKaTC038btkWg4A0HwTxOtFWsKO/7b1lyDeNgiqf6ERW1DKrnI8uEMwjkVQWnEVf1KKLmg== X-Received: by 10.84.129.35 with SMTP id 32mr10533359plb.179.1480326760743; Mon, 28 Nov 2016 01:52:40 -0800 (PST) Received: from gnr743-HP-ZBook-15 ([223.31.70.102]) by smtp.gmail.com with ESMTPSA id v193sm67981776pgb.37.2016.11.28.01.52.39 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Nov 2016 01:52:40 -0800 (PST) Date: Mon, 28 Nov 2016 15:22:37 +0530 From: Souptick Joarder To: james.smart@broadcom.com, dick.kennedy@broadcom.com Cc: linux-scsi@vger.kernel.org Subject: [PATCH] scsi: lpfc: Replace pci_pool_alloc by pci_pool_zalloc Message-ID: <20161128095237.GA30900@gnr743-HP-ZBook-15> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Johannes Thumshirn --- drivers/scsi/lpfc/lpfc_scsi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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