From patchwork Tue Apr 16 16:26:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13632213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0F19C4345F for ; Tue, 16 Apr 2024 16:26:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4EED66B0095; Tue, 16 Apr 2024 12:26:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 49E866B0096; Tue, 16 Apr 2024 12:26:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 366206B0098; Tue, 16 Apr 2024 12:26:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 181E16B0095 for ; Tue, 16 Apr 2024 12:26:44 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 978E71A0B9C for ; Tue, 16 Apr 2024 16:26:43 +0000 (UTC) X-FDA: 82015923486.03.9497515 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by imf20.hostedemail.com (Postfix) with ESMTP id E23C31C0025 for ; Tue, 16 Apr 2024 16:26:41 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=ecUigaXU; spf=pass (imf20.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=quarantine) header.from=collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713284802; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=W4nujb0YdDk9t3Rj1iFJGNDCX7AG0/L7htUY9GmBy8I=; b=yQ7CJ41LM4iMCY4nAYVMOb/q2lsgMj6pNRnurzO0JzxsKC9RcbLeTr1iAwLUpOgkYglALJ CJoZpCUa1A+I//coCTOtz+V1vAG92Yy/nHZ7RWpYQJiemUHcbX45LTcW6b6oQWjUYhDI6L d9sDolBVi2D6sgxgwZ9VpHkIyL1z2W0= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=ecUigaXU; spf=pass (imf20.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.194 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=quarantine) header.from=collabora.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713284802; a=rsa-sha256; cv=none; b=TdmimLkOsNRyy5hDJDn5e9STLli7/mkfR/JcqFEIwXROhWitopWCO1MkeAwFoZTDq+S6yA MrwSl1GAZwu0JcjaQH6ySatkr0xLaPvo+WXf+gkiKr3cLfdoo5iC8oVT7tvj8V/zXjqdCc oDdE2mzMTgbtmb7+fY4hqcTze7Waa3U= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713284800; bh=GL6X/fFSI1ioyhzxGjfZhJACrgZ06TMQ9IkjkuaWBvA=; h=From:To:Cc:Subject:Date:From; b=ecUigaXU7f/lxGTueKQCOBNFi5TeW84E5VmiI2xqJ+bZFZuJwVt51WNjgDrKnV6IJ XgWIzm+H86s6lh8S6oEWDksp+lvLy7cUn6NEAqIbAgzuB/Ut6fDVVSCso/WSuymVWl B90/VNyVUbZSmcwEwsYQKNM/XgsB9WiNW0q9feF27JY4PRYHGrpB67Zbi7R5vvLaH2 qXcmiajvmxZ5OsmpOSkqMdMY9o5pOXr8ysodw87NKVOZQlDXD1++zRXFkAL7TUztcD C7ZQw3qHTMx/xTnm8J6J4nxkCUbhTdYNWD4StI0aPP9Xw1J7hRDAWjxtlBcmrHyWzA 8PIzm0YI+zt2g== Received: from localhost.localdomain (broslavsky.collaboradmins.com [68.183.210.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id BEB733780894; Tue, 16 Apr 2024 16:26:35 +0000 (UTC) From: Muhammad Usama Anjum To: Andrew Morton , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Zi Yan Cc: Muhammad Usama Anjum , kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] selftests: mm: fix unused and uninitialized variable warning Date: Tue, 16 Apr 2024 21:26:58 +0500 Message-Id: <20240416162658.3353622-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Stat-Signature: k44fg4oygdcok1kysrjyg66dqgnfj118 X-Rspamd-Queue-Id: E23C31C0025 X-Rspamd-Server: rspam10 X-Rspam-User: X-HE-Tag: 1713284801-577004 X-HE-Meta: U2FsdGVkX1/DoSQD+onCdZ4++UAJ5hDJGuysRv3ccR1u+Kg0VloJJ9Xk/2wB5/SieEUCW/++V+1kNnuBBZt+Y6ua9fW0yhKXgeTHX+5Vvp6j9CLsZUTlhMtAi0Ukdy9OEuiJ10QJrQ0iRoFkHrhMY7WATbt9nQezJ/bQBwakmntErs3Jo0SNeZQ1oWkHC2wg9H8NSseSYC/po7VxFMcueWuIQ6wtY62ZRArvEgG1HN6V+DBWZkUec6ztRszDJ26Rl+KPrwtEXfvwOG6ftXJ8dmRvUXDax71B6mXrntNyPm8otiiJJntbPhQcPHtVuAZgERbcS+wjITFX84E8LQsQZuwmPl8D18/cu91rSWXaKUfriMBis4RVDLOj+8eJdsYQHsZPQ3nFoB0lSyWM1VMNpaUHqYqNXb8W0nhWacTiOY92+9Yv1V+mm3EWYcIbhaw2mqNYGugTGf9hTgTp8Nts/MUTixU5M2WSa8oGBG7gt8RIsfKIbNLEc0IIk3ahBhdlWYXVm29u9Y9Q0627rmWn4DQMOVrR3+bFEAcwHQ0pzvtJoygk/2TACeV/x/TfEHHKEBmJ5FUYVWP2BmpL8o+ASV0yn1VGuF+TXoomDt8emiD6OUIRxRsp90aN7UilXjxg3xAfh0WQsAbCeslM/xgqHRrgxuIf4yGuI4rdN5g1/Er5JmDS0HIMDkgsHBrj5+5hfnHedKBcc1hAaqLS8f1/QaHezBZwVWOAsgZIIZZX/8PLT4ke0L0LhkPih/qV14Jg8d/e9Ia1HKWGzGmwScervMQVvXU6s2P1/puNh1EW0E8KJOIvaR7GIBRn+YgeNzQLRtOJHCgCW3YE/zFNQbrsQHW7NwH/YHz2i8zfT7s4+uFRkX5y26glwkARwC2hJfbuF8ZLqfp8I7owDOGfL6yTS648D1AKTUDCfeXd/LZGT856GD4zHZlgrGBqKTA2JYOYD7cdW+AD9Q9Zwvu0by/ l2/9R3yM YPsh5kt8MIpUcuRmxoN19877LVzTnrZiAXqXda5UjQCAeITNXrqixlR4OOnP7jQU8rXBVfu1BaMhKpH32tJT6GPZKcFjt+mHLD2awKEFLq1/xp7C0CH7OCePVu6wB74UBPqrsglaodvudIKqauaZXRzo9OQWvjsj0VhxstIFmPfhJp4LeaTuVhNv6JNrW5fD9tqdmKTMixgnql8jIdFNjsTsIW+DiOR1EfPaBP4nfYXHZcZqhRejJWBIqSn3yi114nCp+ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Fix the warnings by initializing and marking the variable as unused. I've caught the warnings by using clang. split_huge_page_test.c:303:6: warning: variable 'dummy' set but not used [-Wunused-but-set-variable] 303 | int dummy; | ^ split_huge_page_test.c:343:3: warning: variable 'dummy' is uninitialized when used here [-Wuninitialized] 343 | dummy += *(*addr + i); | ^~~~~ split_huge_page_test.c:303:11: note: initialize the variable 'dummy' to silence this warning 303 | int dummy; | ^ | = 0 2 warnings generated. Fixes: fc4d182316bd ("mm: huge_memory: enable debugfs to split huge pages to any order") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/split_huge_page_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index 6c988bd2f3356..d3c7f5fb3e7b7 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -300,7 +300,7 @@ int create_pagecache_thp_and_fd(const char *testfile, size_t fd_size, int *fd, char **addr) { size_t i; - int dummy; + int __attribute__((unused)) dummy = 0; srand(time(NULL));