Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp701927pxj; Thu, 3 Jun 2021 17:50:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyG78/1gx+MaiEl78UfHmtRzr5Rl6608pfWNxTccdL1TvcM/AnaUuLa8AkuXyrfXFCIBQBr X-Received: by 2002:a17:906:f111:: with SMTP id gv17mr1702995ejb.435.1622767840646; Thu, 03 Jun 2021 17:50:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622767840; cv=none; d=google.com; s=arc-20160816; b=kXWNJKR0934cmzO/wb7Q+4qN03IUKiqazKKjpfJLTnCUjHOIIL7DCE+lm0Sx7IM8ct Eceot0S9GeTMzv5jAXqQUTIZYb4MitxUIamTMTrANnoxaBIlJtFcQWzTxSzE3OUy+8E9 685mCqWvmtX+ax74lUIw7aIcg35bopmHL1KtruF7Y2VxsCysKykq5UTGgeJ08gvFOa8C 9E7Ywo2Qu42EhZx+UdXuWqsRI1pM1N9nqLcaqWiEBirG32mLMnX95+PDyKsIKgisDQse zTXM1FU9jJ20qIZbvqgZMArIaujza9atUqQcT0P5YULA1g2foT/B+EN/9RizRUuV1pPM aopQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=abdcNtwZlbnpMftEWw/hlXVpEP8uHb15Hb8Hv1n9e2Y=; b=la04dX5okc7Rw7vMaHnPkdeFp7fHs1LjEDZ4if2jYnxOKyLdnblFrrMuMhQbWCwxek WKaEG7B3cvdqwdEFRGPZgUWBRNK7B+mMJtEQxwDP5mWkbDk6Leby/XnJ6gBnN+idOWJW UY09xMR8pwSiwSO4zMxQUOtriCkW9o7yLRhb/spL4NCRjTvw8B6CEMQKKKeZ5Q5WUK3F D/ZcJGpNSDCwZe4LltiyoJ+uNVF4Tk1THX03WDKWZgnSlPxMV1YAvve9uITG3/hNxGCB +1b0q90KNTFqc4YjCPIrpWUOICNk33XiGkNn+AgtwXCmCxzCrQAK1ENyHZT/5ItcwM02 u3vA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si3321229ejy.26.2021.06.03.17.50.16; Thu, 03 Jun 2021 17:50:40 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229758AbhFDAui (ORCPT + 99 others); Thu, 3 Jun 2021 20:50:38 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:7097 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbhFDAuh (ORCPT ); Thu, 3 Jun 2021 20:50:37 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Fx3wX3DT0zYqc8; Fri, 4 Jun 2021 08:46:04 +0800 (CST) Received: from dggpeml500019.china.huawei.com (7.185.36.137) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 4 Jun 2021 08:48:38 +0800 Received: from [10.174.179.189] (10.174.179.189) by dggpeml500019.china.huawei.com (7.185.36.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 4 Jun 2021 08:48:38 +0800 Subject: Re: [PATCH] tools/testing/nvdimm: use vzalloc() instead of vmalloc()/memset(0) To: , , , , , , , , CC: References: <1622425715-146012-1-git-send-email-wubo40@huawei.com> From: Wu Bo Message-ID: <590552c1-5032-5243-20b5-e5701972812e@huawei.com> Date: Fri, 4 Jun 2021 08:48:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: <1622425715-146012-1-git-send-email-wubo40@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.189] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500019.china.huawei.com (7.185.36.137) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Friendly ping ... On 2021/5/31 9:48, Wu Bo wrote: > Use vzalloc() instead of vmalloc() and memset(0) to simpify > the code. > > Signed-off-by: Wu Bo > --- > tools/testing/nvdimm/test/nfit.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c > index 54f367cbadae..258bba22780b 100644 > --- a/tools/testing/nvdimm/test/nfit.c > +++ b/tools/testing/nvdimm/test/nfit.c > @@ -1625,7 +1625,6 @@ static void *__test_alloc(struct nfit_test *t, size_t size, dma_addr_t *dma, > if (rc) > goto err; > INIT_LIST_HEAD(&nfit_res->list); > - memset(buf, 0, size); > nfit_res->dev = dev; > nfit_res->buf = buf; > nfit_res->res.start = *dma; > @@ -1652,7 +1651,7 @@ static void *test_alloc(struct nfit_test *t, size_t size, dma_addr_t *dma) > struct genpool_data_align data = { > .align = SZ_128M, > }; > - void *buf = vmalloc(size); > + void *buf = vzalloc(size); > > if (size >= DIMM_SIZE) > *dma = gen_pool_alloc_algo(nfit_pool, size, >