Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2996847pxb; Mon, 18 Oct 2021 06:18:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjA+JjUKUa6R/sDbK4hGRpGkemDdfEdQrkaSxdFKwHuhY5QYSl/H7OPNAvdtXafbHaf1Q7 X-Received: by 2002:a17:90b:1d8f:: with SMTP id pf15mr32650943pjb.70.1634563107560; Mon, 18 Oct 2021 06:18:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634563107; cv=none; d=google.com; s=arc-20160816; b=VXhXI1mj4JnxXDfIt8vtquBLLbXKvODdLjDqkaPbd8OJBsEPMfSV7BI3+Td4K2jVJ6 L/cYafB1l2TNdmZCg56gk4eTmsiUwZRdmTdPvSZVTPzngGrp1tzY5aUkQkffU2Y4VoPq JtuNTf7lif8kVPvT3bi0Szt94UT/2djGwCXb+u+qqdJgxLUDbCR/SloGsx98xixciyUw 0m9N1jod916LcQrOepWuYubtV1q1evLHUiCKU68rcO1OvJCHja2K63wnJ8sapa81kZaN T3l3F/srt6/ld67bdUbZIIizgoCmGBRDAKqwxOIX470wPb9pnrEzVrhf2unak+haTg7K 3Vqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=t8P0Y9pSfourHfL3VWaA1kG0Cefo08j17YgtJ8eBgMM=; b=elcjs5ahnwU99M5VQugXwx2MiOr/O9wZcuKNYDSw0UfgidDsBYP/OQZ4xNN54OYZ9N W2zn2rsCOOz704EwViMH7ZF6uD73AdGHTUi32WMRidOJeiYRDodoUWTDV9NcneOt3yG/ 2t7uxefmnzbbdxeWzk2lorsKN3lToX9Wf3mnN05tJGjHjNWZvCmyZXCFV1ssEzA6mjwi h9fyhbnAZKQI65MunkLQclczEJArAkcF81mlJoA8jRhfotv1SYv3MZtEd/Sz53/X4JL7 +m9XBD9m/IN5MVIcPwAhX/iB6tQa/9mQ/wfhomlbyJJElsYUrODgF9srU9aJAIjU5cT3 3viA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si798739plq.257.2021.10.18.06.18.11; Mon, 18 Oct 2021 06:18:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231818AbhJRNSx (ORCPT + 99 others); Mon, 18 Oct 2021 09:18:53 -0400 Received: from mx22.baidu.com ([220.181.50.185]:59876 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231167AbhJRNSv (ORCPT ); Mon, 18 Oct 2021 09:18:51 -0400 Received: from BJHW-Mail-Ex07.internal.baidu.com (unknown [10.127.64.17]) by Forcepoint Email with ESMTPS id 5633A34E8BD8722DFF6C; Mon, 18 Oct 2021 21:16:39 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex07.internal.baidu.com (10.127.64.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 18 Oct 2021 21:16:39 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 18 Oct 2021 21:16:38 +0800 From: Cai Huoqing To: CC: Satish Kharat , Sesidhar Baddela , Karan Tilak Kumar , "James E.J. Bottomley" , "Martin K. Petersen" , , Subject: [PATCH] scsi: fnic: Make use of vzalloc() instead of vmalloc/memset() Date: Mon, 18 Oct 2021 21:16:37 +0800 Message-ID: <20211018131637.381-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-EX02.internal.baidu.com (172.31.51.42) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex07_2021-10-18 21:16:39:314 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replacing vmalloc()/memset() with vzalloc() to simplify the code. Signed-off-by: Cai Huoqing --- drivers/scsi/fnic/fnic_debugfs.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c index e7326505cabb..e2fea5b574c3 100644 --- a/drivers/scsi/fnic/fnic_debugfs.c +++ b/drivers/scsi/fnic/fnic_debugfs.c @@ -216,25 +216,21 @@ static int fnic_trace_debugfs_open(struct inode *inode, return -ENOMEM; if (*rdata_ptr == fc_trc_flag->fnic_trace) { - fnic_dbg_prt->buffer = vmalloc(array3_size(3, trace_max_pages, + fnic_dbg_prt->buffer = vzalloc(array3_size(3, trace_max_pages, PAGE_SIZE)); if (!fnic_dbg_prt->buffer) { kfree(fnic_dbg_prt); return -ENOMEM; } - memset((void *)fnic_dbg_prt->buffer, 0, - 3 * (trace_max_pages * PAGE_SIZE)); fnic_dbg_prt->buffer_len = fnic_get_trace_data(fnic_dbg_prt); } else { fnic_dbg_prt->buffer = - vmalloc(array3_size(3, fnic_fc_trace_max_pages, + vzalloc(array3_size(3, fnic_fc_trace_max_pages, PAGE_SIZE)); if (!fnic_dbg_prt->buffer) { kfree(fnic_dbg_prt); return -ENOMEM; } - memset((void *)fnic_dbg_prt->buffer, 0, - 3 * (fnic_fc_trace_max_pages * PAGE_SIZE)); fnic_dbg_prt->buffer_len = fnic_fc_trace_get_data(fnic_dbg_prt, *rdata_ptr); } -- 2.25.1