From patchwork Thu Jan 9 17:38:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933053 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 CA1F8E77197 for ; Thu, 9 Jan 2025 17:39:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5C5B46B0099; Thu, 9 Jan 2025 12:39:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 56B7F6B009B; Thu, 9 Jan 2025 12:39:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 40BA76B009A; Thu, 9 Jan 2025 12:39:29 -0500 (EST) 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 178306B0099 for ; Thu, 9 Jan 2025 12:39:29 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C4CB4802AF for ; Thu, 9 Jan 2025 17:39:28 +0000 (UTC) X-FDA: 82988625216.13.A3E51E7 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf15.hostedemail.com (Postfix) with ESMTP id CBE1EA0011 for ; Thu, 9 Jan 2025 17:39:26 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=IoEfXM2z; spf=pass (imf15.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=pass (policy=none) header.from=collabora.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736444367; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1BDwyNsRViNjuXlosD/y7qBAy6y9oVjeJbNXHd6mzLM=; b=YgGV2F/9zHvj9uiiB8h6HuL+taADSk+LKocg6dhXtKAkTX+2LOYfakvVmJH2Kvh2CXViF2 0IQ+TuQL2HvaDzNPfatk9TMaSRDTgnw4ny2uyGJhp9zuR3WXP7SDwkBanwiHECTf36elmT fMv1L8XsMxc/WGt0Q3uta1kgwwQ0LSo= ARC-Authentication-Results: i=2; imf15.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=IoEfXM2z; spf=pass (imf15.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=pass (policy=none) header.from=collabora.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444367; a=rsa-sha256; cv=pass; b=JilxgYl8IL9dl3KqZzlf4Q3mTGib7BqJO8icBeEwrSoLd+SfOgR/PRlmhBNkjrESY7jUzs FHhg3Ai9DmiaYprgZtO5J1btTvlvwC0RlnRxWhO3WwqWlcio8gUyseY8mTo8yJuLwC30gO iyWVeDo6BBD9eOXCmxH5lHQL8s3eeaA= ARC-Seal: i=1; a=rsa-sha256; t=1736444353; cv=none; d=zohomail.com; s=zohoarc; b=L3XyLRs0/trsxb9q5kJQLxsWkrZgP4LKcSTY9MpD+TWdxL3bVef3hn1GeNer/FNAPcWug+2y9E2FUbiyd7XM2yaey7hVrg4VuiHM2xcfr1iPO2Bgdbu32D5rAdbbFupngXZt2REyMRDKk8XaxBIDonxRNahZSIMY3EFWU4mfDeQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444353; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=1BDwyNsRViNjuXlosD/y7qBAy6y9oVjeJbNXHd6mzLM=; b=Ej8pZXtD0YiNC16sxLhqORerDh5GbRffB/N2oicvJ7Sa5HaRRrRfdSHDmjl4SpvxZ+6qpIOhO/f/uKSyDlEjp0I4jYyt/2bYANYp3bINuiMgJmFqnmRTp5VO2zxS90JB9uO/5C38EosKaWTAeLv2Lp5pzKGeKfWkg7ngEjy6gzg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1736444353; s=zohomail; d=collabora.com; i=usama.anjum@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Reply-To; bh=1BDwyNsRViNjuXlosD/y7qBAy6y9oVjeJbNXHd6mzLM=; b=IoEfXM2z6Y0Gt5j9jm1HV1EL/AHRZJTGgqvgphvkAE2zkV/mWHBZP/KiSGM4qyrg dxIo9nl7hsc+vRkFFA1R+eo1y0jn5uqf80ncEIaqmVMbWMd3BP2MbGT9MTzg5V2+/mO uGLS8n4/Nt3yXvwUPX2SZvJdHjqcUrNQDuvKBtts= Received: by mx.zohomail.com with SMTPS id 1736444351927807.2354560001573; Thu, 9 Jan 2025 09:39:11 -0800 (PST) From: Muhammad Usama Anjum To: Kees Cook , Andy Lutomirski , Will Drewry , Shuah Khan , Andrew Morton , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Muhammad Usama Anjum , kernel@collabora.com Subject: [PATCH 05/16] selftests/mm: kselftest_harness: Fix warnings Date: Thu, 9 Jan 2025 22:38:31 +0500 Message-Id: <20250109173842.1142376-6-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109173842.1142376-1-usama.anjum@collabora.com> References: <20250109173842.1142376-1-usama.anjum@collabora.com> MIME-Version: 1.0 X-ZohoMailClient: External X-Rspamd-Queue-Id: CBE1EA0011 X-Stat-Signature: m8gjx3uoj9iitstexa5rcdubce85xour X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1736444366-56318 X-HE-Meta: U2FsdGVkX1+eYKrDxPe0z3m98qbLDKPp78qVsf+0LGInpo1U4AQ4dk3+AndGw89hEP5QJM+jxp0Ui7p8Xcz21dqXtDJqQX5jDHbyhoi2IZOc0pa6pfrQi0yFKqKjygBJeKVQy5MKtb/yVpw0K90fC/+YBugDnDdXXmCJOcJNitwWmJTZm1o18WrNiOqsHh7QyKy4RsQCxuUMkCSNfTnAAmp81zm8HNyDZUe2l/K3/cts+RIaH7iRLoccjun7V79Di1x60lisQIhswt2KEBOs+Rb36Ya4qAbKBxvgXCor/QvUgk1MiHUvmnQEzjnYImGhcEI5L19p1yScCLqc6T+Ja3/kquU+YsTPUd3MaiAh0WCOsLq7sqW3l4QwzYVfjuwjLWfirDUQKPPZtQNrozW9HUYtKXO1J0Bb66YECjm5Yg6kjQQmaF2gbGhWQZ/rNRZ4HyAbIrZKwjcz9pUOZvLG/kPyUgOdiIXkL2t50Ka1s2btF4IBgx5SK83ctaZeoaYUoXKk4eRbfy/utooJxO8nl3im/mcFova82WJ4az4NyNFFrKZbhxJ9a1zi4g+MgX228M9kaLyBQq0nLVseRVknC5Fg3DCq9nbyi6ohntaZmeBkI02abPyN45zehw8m6HqQZvKQ3EFHa2Xca6TZAqT0szD72iN/NST7U1tMS3ZfOyGF6exs/BDozL4P+owmr4Hc1SnzyvQ6oByEJ/Ohuuof1edYGxd46EGPRH4Xyncts4Alj+3GygAYJkbblr6vulzjiKCXakJuDvRHdSEB71VhhuvyLEw3gLN5R1tOj7s4Gy1PmKzn6Nv2qcSHLzJAnKLpm7VzrR6aIjw1VKLb2UvwNrQsm4J7TJVSo0hJ+t6ETfkAEdxmiQ25Y+ZKx7CChtyNon3BdZmyL6zDVGGHVdh0Smo6KhKCZqdCisWIfie6gkBtIgK/d3gVJ7gX+VRs1ydzHJHtP2G2P+odkKNqPrS vHSYZr8B +R0PjqrcXXjReZoNZv7lTrYsbDpzAw/N/5KwstDeLhlT/+qWsoYSpWkeJg6HTXByCQZeqYvFrKeG/4yzu5Xp3NKHhQtu56vSsbItB1Hjf7Do/hkMV1dodYrRM1Sp71We1h3kg8zC7x8x51rU3rDU5WbQ7D/10bQfY6Mo4121US23Q+0QKu0VJYEzDDXFRimWIdlDY4GNBeVtGos6yFLjb2BS6OLkAKJ9CuBzPWKWd7KiqZt3ymRLBIbD9+M2GrWDaCLgSH9GdDWNqvu2poxzx0I93k2jOhFN7uPp2bNuuHKtbeo+hAouAAH/jYfHGCOzy39XAgL+IURng4DmI0o5lFFs+k8L3txVmVTbd4/AKx6+CrVt9yAIbMgZIrbhTYlo909KKJjtmQH8eGzt73vi4sttsLA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000135, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Found warnings through hmm-tests and mdwe_test. Fix following warnings: - Mark unused variable with unused attribute - __EXPECT is causing types mismatch warnings when __exp is unsigned and _seen is equal to a constant number, __typeof__(_seen) returns signed type. hmm-tests.c: In function ‘hmm_anon_read’: ../kselftest_harness.h:523:52: warning: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘int’ [-Wsign-compare] 523 | __EXPECT(expected, #expected, seen, #seen, !=, 1) | ^~ ../kselftest_harness.h:759:21: note: in definition of macro ‘__EXPECT’ 759 | if (!(__exp _t __seen)) { \ | ^~ hmm-tests.c:303:9: note: in expansion of macro ‘ASSERT_NE’ 303 | ASSERT_NE(npages, 0); | ^~~~~~~~~ - Mark variant as unused: mdwe_test.c: In function ‘wrapper_prctl_flags’: ../kselftest_harness.h:177:52: warning: unused parameter ‘variant’ [-Wunused-parameter] 177 | struct __fixture_variant_metadata *variant) \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ ../kselftest_harness.h:152:25: note: in expansion of macro ‘__TEST_IMPL’ 152 | #define TEST(test_name) __TEST_IMPL(test_name, -1) | ^~~~~~~~~~~ mdwe_test.c:23:1: note: in expansion of macro ‘TEST’ 23 | TEST(prctl_flags) | ^~~~ Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/kselftest_harness.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h index 666c9fde76da9..76e6b3be0e9d6 100644 --- a/tools/testing/selftests/kselftest_harness.h +++ b/tools/testing/selftests/kselftest_harness.h @@ -174,7 +174,7 @@ static void test_name(struct __test_metadata *_metadata); \ static inline void wrapper_##test_name( \ struct __test_metadata *_metadata, \ - struct __fixture_variant_metadata *variant) \ + struct __fixture_variant_metadata __attribute__((unused)) *variant) \ { \ _metadata->setup_completed = true; \ if (setjmp(_metadata->env) == 0) \ @@ -756,7 +756,7 @@ /* Avoid multiple evaluation of the cases */ \ __typeof__(_expected) __exp = (_expected); \ __typeof__(_seen) __seen = (_seen); \ - if (!(__exp _t __seen)) { \ + if (!(__exp _t (__typeof__(_expected)) __seen)) { \ /* Report with actual signedness to avoid weird output. */ \ switch (is_signed_type(__exp) * 2 + is_signed_type(__seen)) { \ case 0: { \ @@ -965,7 +965,7 @@ static inline void __test_check_assert(struct __test_metadata *t) } struct __test_metadata *__active_test; -static void __timeout_handler(int sig, siginfo_t *info, void *ucontext) +static void __timeout_handler(int sig, siginfo_t *info, void __attribute__((unused)) *ucontext) { struct __test_metadata *t = __active_test;