Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5521170imu; Tue, 13 Nov 2018 07:49:19 -0800 (PST) X-Google-Smtp-Source: AJdET5eDvc2NdALVxzfVHTdi8+5vXix/dBLHJWh2XxYBK1fkPkzJf/NoYQt9+tBupz9zLWZjJrHu X-Received: by 2002:a17:902:bc8c:: with SMTP id bb12-v6mr5336450plb.275.1542124159355; Tue, 13 Nov 2018 07:49:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542124159; cv=none; d=google.com; s=arc-20160816; b=ErIKWv4d0yPbFqMMkrGia4Celo6Ko4R+GPWVefRo5yB4TUEm6CTyoTm0QkiRP7SKuZ bL/9d/ccITvWe6Xe1UA9I+q1QJpPqMXC7wrHRVt7wVu4LaXNQqbQZzAQyHtk39xncza/ TkmWsox4EI9yrRncfBuiquuOkRei8vQWsxjqcdTlzzP3u0yqBROXyHgvgDE/y5TQ3XZh 7wz4kDRt3XIl9IU60bRgZuzRM9MwWZdytG0QLxiVnDMRgi4dN7cf7o5zK36WZGFaBczC 2IlV5CsWPPL1NOCjVHlg90nihDe/84yorSxb9Vh9xgdgQUYbWWZkAdDGt9TBgsZWDR/W mW1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=Jtq/5xC7grq9FEz0vQdUM8zOPrkbSQzcFW2uJsThPqQ=; b=Trj/IQffxbZ1YkmBOvoCjtY6B79ydd/N+zMDrCBTXUkakHYeTRtYmlypOkfgvktIB/ xO/WvexfEMIgjkSwCzwn/6eLLezOhCV3kDwW/mc+dzuz5jz+WF10qPFeNt1YdSZB+WhR JLUeNvOcd6B1Obx4QJi2RtOUez6jIkkulsBm/23uO7ERgCgZYAEBGqRHdqmFfMYcoHE+ opxz0ZFFViMUXBS8KL5ivX76/7p2mwhrc2jWa/KkQ+L2/lklMwQln1E1G+3O3ByRAk4B pSCiW6MNE62HhILqRxBnyJCzZ5BY2y5VNMf/SCSGo7HECCvVi6RLHGGkVYm6xpoUMPG4 iSpA== 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 x11-v6si21264207pln.425.2018.11.13.07.48.57; Tue, 13 Nov 2018 07:49:19 -0800 (PST) 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 S2387866AbeKNBpf (ORCPT + 99 others); Tue, 13 Nov 2018 20:45:35 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:37660 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726932AbeKNBpf (ORCPT ); Tue, 13 Nov 2018 20:45:35 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 42EA1663A5055; Tue, 13 Nov 2018 23:46:54 +0800 (CST) Received: from [127.0.0.1] (10.202.226.41) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.408.0; Tue, 13 Nov 2018 23:46:50 +0800 Subject: Re: [PATCH] drivers/scsi/fnic/fnic_trace.c: Use vzalloc To: Sabyasachi Gupta , , , , , References: <5beae8ff.1c69fb81.bd59a.b7fa@mx.google.com> CC: , , , From: John Garry Message-ID: Date: Tue, 13 Nov 2018 15:44:46 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <5beae8ff.1c69fb81.bd59a.b7fa@mx.google.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.41] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/11/2018 15:08, Sabyasachi Gupta wrote: > Replaced vmalloc + memset with vzalloc > > Signed-off-by: Sabyasachi Gupta > --- > drivers/scsi/fnic/fnic_trace.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/fnic/fnic_trace.c b/drivers/scsi/fnic/fnic_trace.c > index 8271785..129ab27 100644 > --- a/drivers/scsi/fnic/fnic_trace.c > +++ b/drivers/scsi/fnic/fnic_trace.c > @@ -468,14 +468,14 @@ int fnic_trace_buf_init(void) > fnic_max_trace_entries = (trace_max_pages * PAGE_SIZE)/ > FNIC_ENTRY_SIZE_BYTES; > > - fnic_trace_buf_p = (unsigned long)vmalloc((trace_max_pages * PAGE_SIZE)); > + fnic_trace_buf_p = (unsigned long)vzalloc((trace_max_pages * > + PAGE_SIZE)); If you remove the extra brackets in vzalloc() argument then you may not spill onto the next line. > if (!fnic_trace_buf_p) { > printk(KERN_ERR PFX "Failed to allocate memory " > "for fnic_trace_buf_p\n"); > err = -ENOMEM; > goto err_fnic_trace_buf_init; > } > - memset((void *)fnic_trace_buf_p, 0, (trace_max_pages * PAGE_SIZE)); > > fnic_trace_entries.page_offset = > vmalloc(array_size(fnic_max_trace_entries, >