Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp191005imm; Tue, 28 Aug 2018 20:07:41 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYllJkrBE6VuQT4Vku3aszB/cktpuOha6n5ynusRYhmYVB42riuAFvSRsOvf72t3EVjy0Au X-Received: by 2002:a17:902:142:: with SMTP id 60-v6mr4018557plb.146.1535512060964; Tue, 28 Aug 2018 20:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535512060; cv=none; d=google.com; s=arc-20160816; b=ZKVo7ndCeSGTr+7vka0pPRNyGbbODyTFwPS0aKbH6a/XeEnocGnB4hHLKu3O1exMj6 7Z9o1v1YwUFPLWx6cCf/UuBOAt8br/BkU+JCibJN5ZBktM4pMeSFl6pE5DQcVWOKrZ3f 4RcP2DXru07G49Th4iDRzqtdyund2ns7/ySunI8KVft55Gc62w8lpNrq7Rn5xjjqHn1E psCBdF7F3b8p1+rmqMG6JtwB8YprfvYODpMDpZm8QCs5sVkZuh/JOCSCGR8B1bHrPFlx hCtxetSZXysxbD29zEybx+9jnk4Dc69ZhL9LkAMAF6BgU4cmCsTbsE3oZwz8Oxkx5nS9 C0PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :arc-authentication-results; bh=4aOjNYYipLL5dWzl4KBBsoMq4gQ5JlYIvevpi41M+/E=; b=ESIpknOB/T9Yua+b7ZUdR7Y7579Y11ByE6+qH2fFWd4bcTjzZX85u/npSCxTBunx+G Q+lqsKnvaHhe1wR49blRhcFuBagtVTeWRW1F1AJhRFgSz4hYNFh+M8UvAYQS6LeKUQd8 nD1nfOQpoTTzzLvowFLpYsPQ77W0wqpKl6QAYT2MgZNyVNnuHpfjmtDnis4/1Uh9QdiZ mcJq2nmwXtBkiEbgHPSq3qUFCYu0o7nE3AvyFeebQPQghXc1W+mVipqnZvgRbhHAYle4 3fUj0whG4fxO9n0I31Ig0wmkyY4Q2oFTVB9f3f3w8GQD8aoJ4bK0xkxN6Tq9thZYq3xe h0GA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c18-v6si2609887pgh.530.2018.08.28.20.07.25; Tue, 28 Aug 2018 20:07:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727429AbeH2HA6 (ORCPT + 99 others); Wed, 29 Aug 2018 03:00:58 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:10422 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726479AbeH2HA6 (ORCPT ); Wed, 29 Aug 2018 03:00:58 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.9]) by rmmx-syy-dmz-app12-12012 (RichMail) with SMTP id 2eec5b860da9967-3c80d; Wed, 29 Aug 2018 11:06:17 +0800 (CST) X-RM-TRANSID: 2eec5b860da9967-3c80d X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.105.0.243]) by rmsmtp-syy-appsvr05-12005 (RichMail) with SMTP id 2ee55b860da7388-9e139; Wed, 29 Aug 2018 11:06:17 +0800 (CST) X-RM-TRANSID: 2ee55b860da7388-9e139 From: Ding Xiang To: sathya.prakash@broadcom.com, chaitra.basappa@broadcom.com, suganath-prabu.subramani@broadcom.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: mpt3sas: use zalloc function for alloc and memset Date: Wed, 29 Aug 2018 11:06:13 +0800 Message-Id: <1535511973-25199-1-git-send-email-dingxiang@cmss.chinamobile.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org use dma_pool_zalloc replace dma_pool_alloc and memset Signed-off-by: Ding Xiang --- drivers/scsi/mpt3sas/mpt3sas_base.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 59d7844..d7ef671 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -4516,7 +4516,7 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc, i = 0; do { ioc->reply_post[i].reply_post_free = - dma_pool_alloc(ioc->reply_post_free_dma_pool, + dma_pool_zalloc(ioc->reply_post_free_dma_pool, GFP_KERNEL, &ioc->reply_post[i].reply_post_free_dma); if (!ioc->reply_post[i].reply_post_free) { @@ -4525,7 +4525,6 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc, ioc->name); goto out; } - memset(ioc->reply_post[i].reply_post_free, 0, sz); dinitprintk(ioc, pr_info(MPT3SAS_FMT "reply post free pool (0x%p): depth(%d)," "element_size(%d), pool_size(%d kB)\n", ioc->name, @@ -4852,14 +4851,13 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc, ioc->name); goto out; } - ioc->reply_free = dma_pool_alloc(ioc->reply_free_dma_pool, GFP_KERNEL, + ioc->reply_free = dma_pool_zalloc(ioc->reply_free_dma_pool, GFP_KERNEL, &ioc->reply_free_dma); if (!ioc->reply_free) { pr_err(MPT3SAS_FMT "reply_free pool: dma_pool_alloc failed\n", ioc->name); goto out; } - memset(ioc->reply_free, 0, sz); dinitprintk(ioc, pr_info(MPT3SAS_FMT "reply_free pool(0x%p): " \ "depth(%d), element_size(%d), pool_size(%d kB)\n", ioc->name, ioc->reply_free, ioc->reply_free_queue_depth, 4, sz/1024)); -- 1.9.1