Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3021326rwb; Mon, 15 Aug 2022 16:18:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR6AZuEfdXdc8QYpE3ZnFbS1WghjrSaU5MjIqzSv8+eTgX/ik4DrIeICwOBjwskg1ZcmG1qj X-Received: by 2002:a50:fb13:0:b0:43c:ef2b:d29 with SMTP id d19-20020a50fb13000000b0043cef2b0d29mr16453635edq.378.1660605516785; Mon, 15 Aug 2022 16:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605516; cv=none; d=google.com; s=arc-20160816; b=fNEr79/9ducs7JsEKVUxojxMisw6XRp+4ynNWFGXXFTWAi5LhjKkiFB7P5S0ZBt7Lk lhmYOv7d0wMHDE3SeyRSR2WYp8eaqwZFRKslamG30H71f20L5VNia/Dftu+vEmBCJ9uY Dilca6bkY2wh7k/lyEzhGgZ4etT0AzZsF7DSVQxwAXg5LbDnuZUc9jExnHyfRT5YyL2A hzQLfEqh63nUY3JaXqsZdeMlx+nQ2+PdPhYACly70wL2h9u4sIktoXOA2A51sOynQ7K6 ym6YC66onfJLcrWTsgIoC0Ku9AARNfhUX5wjvXHGkWkznCmDghNCuPZw7mVs3GyPEr/5 22Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=W9/gAj+fMxN3ZhlzuTBkwgYCaKbgLpmLDNui2HkSMfg=; b=zMiY5OkIC5q3aqXKe7kBMkBPK1I1CIPAdVptCD/ow/Mae6P7Qm7fF5WVNYInnuwH7r dYYBYSm7LsSQueFjyfMo1Lc2bpZ7lmu1e1ywNkSqsbBPmvLpXy/7Jhg6A82439Yw7Zdh DB/3I62oYMpC7dbIXVjrg2T0mVs4l+ql0uh+87PZWhZERc6F5bbOAWWH88WuK7u1eS5g TdC5nDJHxZQwmveeXHm8PwsNNvL0T0lbEusoSSzaG0T4fKxD1T0OYJWNWSLAeawstJqz wm7W5HZ02r39z9joB9V3duNSP5ngfbzTXbfPoXnN5ISYk8cjvHsExjH3kScDn/aez+Vs qnAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BmoCVIKm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a056402520500b0043cea582924si10067615edd.54.2022.08.15.16.18.11; Mon, 15 Aug 2022 16:18:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BmoCVIKm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349384AbiHOWZ7 (ORCPT + 99 others); Mon, 15 Aug 2022 18:25:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350825AbiHOWSi (ORCPT ); Mon, 15 Aug 2022 18:18:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50CFF419BD; Mon, 15 Aug 2022 12:42:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E1FF86068D; Mon, 15 Aug 2022 19:42:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE805C433C1; Mon, 15 Aug 2022 19:42:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592552; bh=gAhaqdi2MNJ7YsEZoDyKRrz/8+l523h+AKKJdZP7w0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BmoCVIKmLCppoQUllEotr3bgrfuXICximXmwvRrhsifUz9Mr26fV9Q3OxA55NPdvq wkZQWIYCf8fxsO/LkUMc8T0fy77AIgiCPIWy3WtEhsRcsTWji43mBE89wQmhOrvUVx J8iF7eIElzfXROC6GP/GUQ0kTzcODJ4QRn6fCD3c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , "Souptick Joarder (HPE)" , Mike Kravetz , Shuah Khan , Andrew Morton , Sasha Levin Subject: [PATCH 5.18 0807/1095] tools/testing/selftests/vm/hugetlb-madvise.c: silence uninitialized variable warning Date: Mon, 15 Aug 2022 20:03:26 +0200 Message-Id: <20220815180502.658060125@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 3d5367a0426da61c7cb616cc85b6239467e261dd ] This code just reads from memory without caring about the data itself. However static checkers complain that "tmp" is never properly initialized. Initialize it to zero and change the name to "dummy" to show that we don't care about the value stored in it. Link: https://lkml.kernel.org/r/YtZ8mKJmktA2GaHB@kili Fixes: c4b6cb884011 ("selftests/vm: add hugetlb madvise MADV_DONTNEED MADV_REMOVE test") Signed-off-by: Dan Carpenter Acked-by: Souptick Joarder (HPE) Reviewed-by: Mike Kravetz Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- tools/testing/selftests/vm/hugetlb-madvise.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/vm/hugetlb-madvise.c b/tools/testing/selftests/vm/hugetlb-madvise.c index 6c6af40f5747..3c9943131881 100644 --- a/tools/testing/selftests/vm/hugetlb-madvise.c +++ b/tools/testing/selftests/vm/hugetlb-madvise.c @@ -89,10 +89,11 @@ void write_fault_pages(void *addr, unsigned long nr_pages) void read_fault_pages(void *addr, unsigned long nr_pages) { - unsigned long i, tmp; + unsigned long dummy = 0; + unsigned long i; for (i = 0; i < nr_pages; i++) - tmp += *((unsigned long *)(addr + (i * huge_page_size))); + dummy += *((unsigned long *)(addr + (i * huge_page_size))); } int main(int argc, char **argv) -- 2.35.1