Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3135569rwb; Mon, 15 Aug 2022 19:02:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Tc+Ga5erGSt9ybjZ4ZCc8y7MrlYZiCWVjoFS+8lmNEOyIr1q7Saoucx8R0Lqud0klIiVZ X-Received: by 2002:a63:4f5a:0:b0:41d:10ae:6203 with SMTP id p26-20020a634f5a000000b0041d10ae6203mr16491299pgl.258.1660615351839; Mon, 15 Aug 2022 19:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660615351; cv=none; d=google.com; s=arc-20160816; b=ueMttcyHv/SinW1SKZ8jNsunJ6zjzQa+2CJc8xxNy3SCEJdD26F2F+MaJgGM4477X6 Bv9hx5ugo09LWxTC/RVUm+OaoSl+3ThGMDtZNRhxn3QVC7cG8Lvf7ikHTnAtcDV1+NqT dutxHv5403K1mGgKIlqWFdSRlhwlH/30O9CmjKpr4Lx0aBgMjC2dboiaKpHRvrPHjZNf MzFAieBGplIYvDa3Z4LYEvVRBnCmOQgSRz+S0yrlSUYc6iFSY722JaW2E1ZGUMd+SStR 2T6z3dfmDEV1gHuaWdSs62Y38ZHoolPrCi9XHGKpuY18H3WxXeeZkAJbYe3DEoKi3gET plhg== 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=P6mSCWblI4s9qyHp94X456gUR7dIujllZ/ke4M8JR3NP7YOBJNi/+onfYByVcbNkoR Kp0+jsh5otPDEwfsbuw28gf40dngTxMi6iak3eDfc4npwXRfrDAHnJBMBPNmN37p5KJo 7bmpGL1MEfsA+oQCyKzuxFyawU8W75f4p0n0MeJGTiJ8DohaUVhrdcN5Dkbcf0YcEFp2 WRj/aVMKc7WGOBtywHVjgMzpuSOgXZSNG6rUeZW9UDU6gRZViCX5R1PBFBEEHxEQn5g1 Cj/0k5YOGdejQ1Dy/u7gRjDkqLxVJ3a3OaEpV1JMssBhl3zUPTOKTjb18zSyMxK+lkE+ rR/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x3czMBjj; 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 s1-20020a170902ea0100b0016d2a83e761si14165352plg.243.2022.08.15.19.02.20; Mon, 15 Aug 2022 19:02:31 -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=x3czMBjj; 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 S1345693AbiHPAhd (ORCPT + 99 others); Mon, 15 Aug 2022 20:37:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349222AbiHPAfu (ORCPT ); Mon, 15 Aug 2022 20:35:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84D6418A08D; Mon, 15 Aug 2022 13:37:44 -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 ams.source.kernel.org (Postfix) with ESMTPS id EC04EB8114A; Mon, 15 Aug 2022 20:37:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48456C433D6; Mon, 15 Aug 2022 20:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595861; bh=gAhaqdi2MNJ7YsEZoDyKRrz/8+l523h+AKKJdZP7w0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x3czMBjjK3Ee8eBFbnAqCN5WXu703zp7Upkf9ovZ0BR9XaffjDTbWurR3b7n2hcKU 3P/0WNeerFCz0fI8sOUHBrGWet5r4wwPuol9ZhYdoUjSYVpjdv4MIfUSQFM7d80LXW mlZsWzKVbA3TFmPAOUmJe8vM55ForjVRP9IrWwIo= 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.19 0866/1157] tools/testing/selftests/vm/hugetlb-madvise.c: silence uninitialized variable warning Date: Mon, 15 Aug 2022 20:03:42 +0200 Message-Id: <20220815180514.107865945@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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