Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2221748pxj; Sun, 30 May 2021 18:27:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9h0BI+isL/ZS2XzVI6IGhEAvmhsDaIJSKKo0ce5AqmMbsbHz4N2wQv9Gne5LqqKAqXyKG X-Received: by 2002:a05:6402:754:: with SMTP id p20mr4135600edy.311.1622424420865; Sun, 30 May 2021 18:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622424420; cv=none; d=google.com; s=arc-20160816; b=K152iz9qhb1zLlMPOokAj2TNtCs1iZlVBqaEBGqkbz+s9bzGsfe6XarIcwgieazqEB ytJCd90kqWwxbdmqTqtuJ74YQ6sZ6JUpaXMePqR7izTs7nEVoYw8mgYlPhk935QUP0kz h8IWsrAXoBRkcICofD1zbWZVot7B9A2cO4mERnXElrAq2lEix1a4l3W9Bk0CPNApSB5i KhisuYzHjCaokNZLQfX9bkQlztotAfpuGd9Z0cJP+2Zg7DCojget1YQ0iHU1E69UaXgB dzpjtVgycAofF96k96g12ZyfehKTOY9DW8p5x4l0+NJAPgrkZmBKZREXuogCHZMZhD26 /aKg== 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=3FaUnTekPkUTx3rkYcXPf3YttAkaIMfbCIB5JvpwCyg=; b=q1agwXvcBdAtmhf4XfHUgkZvGHC5nNe59V2NV0ggsjW7ssgIdcs/u9wQcW1DdD0EWF iCoPauLRLAY+bw0pNaxPFss6VaHMqZoGJKPz9psMpTa1mihxsTWG6hvwIdCjri2C1Qlo lWXN+cl4GcWDun750yVC98OlpabsVa3YHJkZPq9uXklu4yHFoRi1KBdb+gj0adDTYgP3 xGPSiC0UlhCGj9mtCvFm4rwaj/Vu6l3XMjI90kcPsT06dR0hr9YFDNc+HyDMk4hxUYIC uIooE8qseYvPEqcRvRmkuCLbS4/LEtdDeRReiwl8UduDF3nG+NHTP69l8ZyEfDNk/15L 4BLg== 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 h8si6665794edz.253.2021.05.30.18.26.37; Sun, 30 May 2021 18:27:00 -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 S230008AbhEaBYt (ORCPT + 99 others); Sun, 30 May 2021 21:24:49 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:3290 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbhEaBYs (ORCPT ); Sun, 30 May 2021 21:24:48 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Ftcqm38VPz1BGCK; Mon, 31 May 2021 09:18:28 +0800 (CST) Received: from dggpeml500019.china.huawei.com (7.185.36.137) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 09:23:08 +0800 Received: from huawei.com (10.175.124.27) 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; Mon, 31 May 2021 09:23:07 +0800 From: Wu Bo To: , , , , , , , , CC: , Subject: [PATCH] tools/testing/nvdimm: use vzalloc() instead of vmalloc()/memset(0) Date: Mon, 31 May 2021 09:48:35 +0800 Message-ID: <1622425715-146012-1-git-send-email-wubo40@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.27] 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 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, -- 2.30.0