From patchwork Thu Jan 9 17:38:27 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: 13933030 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 E2D6CE77197 for ; Thu, 9 Jan 2025 17:39:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78D766B0089; Thu, 9 Jan 2025 12:39:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 73EAF6B008A; Thu, 9 Jan 2025 12:39:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DFCA6B008C; Thu, 9 Jan 2025 12:39:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 3E7A26B0089 for ; Thu, 9 Jan 2025 12:39:10 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D09B5160335 for ; Thu, 9 Jan 2025 17:39:09 +0000 (UTC) X-FDA: 82988624418.22.A123527 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf25.hostedemail.com (Postfix) with ESMTP id D559EA0018 for ; Thu, 9 Jan 2025 17:39:07 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=gl1Q3WgO; spf=pass (imf25.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444348; a=rsa-sha256; cv=pass; b=wD3tk85/kMaMg68bffT2D+BIMWdB5da5tgRG5FeKzHp/9nwx90dlbCqfSI74pCncyLiFH1 2nvzTHvegpiALzvLYm6AHVuRHmiLDbyM+dm9bpTW7RHPWGvH4kS1pQsGuknmBuNqA38yqe Mw2MixuOH8IQ2rFaL9Ltnpt2LfMXzfk= ARC-Authentication-Results: i=2; imf25.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=gl1Q3WgO; spf=pass (imf25.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736444348; 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=JeU06unvxMwqmD+RVXrBS+6nxgmgOdhK5Xdrp6nR3mU=; b=tIi4R2IGGRGvKuNxE2OmExILsThS5kl0gvl7uKcDTDPnI775u5DfLxz4jJF5GsWfLEBYyV ukF8WJOE13XGoHL9+3/Dmy5EOW0U0PFlT+DvQKo9xFGGO+h5BvlDuYNVUo+8MEWFdPfub3 0bSAcaRnUPln0K9L5sQRL+jJrFnPtmA= ARC-Seal: i=1; a=rsa-sha256; t=1736444333; cv=none; d=zohomail.com; s=zohoarc; b=apwhxndeqDHgaqQNLHJKVCQ+hxYR+oI6HYu05Pigyw566JaI7zAYmypd6lIL+zDGvg9tPrhxR8FDXx3tauPDnt9Piu0+TL4vM4zXM6uZr1JQjHEKtCy0F5SkT9QgL6Vqoc5wdQc82uPhA9kNCl1v965T+bwn+iELGYc1MiSx8Xs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444333; 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=JeU06unvxMwqmD+RVXrBS+6nxgmgOdhK5Xdrp6nR3mU=; b=IsCUZ8XTcOqw4KrCcDJZgc0MWXtgHxSkxUo3c/ko1ameuAqSr9QSe3t4aPn/nzrJOMUVa5WlHxsJR9MHrUX5QFp47p7F+qSRKAZY73M93/pJtV4zjlJjbJ9ch1YfRl97iV/JuPLaa0ggT3QPMOvd5AU5gFE+OItsYgWY0uget3o= 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=1736444333; 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=JeU06unvxMwqmD+RVXrBS+6nxgmgOdhK5Xdrp6nR3mU=; b=gl1Q3WgOuNZzLoBblXAbbFsZoNjLVNka14ePbrpJXrwL1v5frHyboOAJv6BPNt5C FHIh0oFDBvaBnXnIV50BZvEwb16zyISMYJHYson+jnsjxwq9IR+bRpyST3PHAsvIo8x Lg1gjw2FDFC5SiY+FhBqIyClXOSl3r4/6VDl2DdA= Received: by mx.zohomail.com with SMTPS id 1736444332163303.84388479702955; Thu, 9 Jan 2025 09:38:52 -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 01/16] selftests/mm: remove argc and argv unused parameters Date: Thu, 9 Jan 2025 22:38:27 +0500 Message-Id: <20250109173842.1142376-2-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: D559EA0018 X-Stat-Signature: k95yjjey6nwnjbf4two4t4618n63cccw X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1736444347-582631 X-HE-Meta: U2FsdGVkX1+HJRVxbYpcfygqd/XPIdwa/jGaWdXBihD68VJqw5LMpbpWp6v3zL9Ygv6pZ4d9Gtnk5R3+LKR9uz06ImCrOopnKLMBjYrwYEqFm+n6UdEQIXfYerYYbz7CnTJ76ke+DgkZ9T2Qi1uzIKkfBLFkZ+x3NUB+DoF8P1CcXtb1bAAgTbEz2h439aanps3FWoBe4JZfhnxgKC2TUDGabAIhj2zcOy73dBgu7yHiPI/TDYT1xOvr20mwQ8J3as2wQYwd9jJgYFJYYfmJ24pay9rD9XmjjRjAflsQL5L+/OjYknkzL7+9S29EcvOgbmq4KiIoq51mLEk1Yd4fuf0t+RvQlm2PTPJP8xsdPjZimFU8u0lriIvYn26RBDsRezMf4CI4aVe6BtytvlRz/I69ZLDBkYagW35l8MRbeePpZVHmCRG/R+3LOrfv6ymi2BShzmsifM8BcnLne8yXauQOcx+aZqAleTbElscfDCHrAS2sm891V+58N7sXYYLyO/n702JFMlYuJ51i9r77BiSxlihrVM1EyrQ0bTdh6nNsjz3B+2qmiPD5ZpjJ2xTcrPABoR+LwlHxHUpRqBK/HaspqXVJZSlVx3AtauMOHGmERj8LKWaXkpah2XtDTetFye3aQ1EcyddCKzsxVPtuVu1qRijq4Z69vpkpsQpjd8TySRLi1bPJVJvKoBlCBIeElAHw1LObTQnqHThGx4X9AyO6WDM1HuH+CLQq9Bh79LgfZ7zyA2GwLzhi0mKhySPSMPkvGlLRauOjFEVv/ZI2qFk3NdmRuXNMoyFFiOT1S+K6kbOUFc+r5UyN0Ifq/La0K6hNjoL+e7KO2bYX7mJtH6V6xUZ3LYJqlmGsKRzXzj1KYXDXaxh5/USmrdmjVor+YYoLEFofLRufIMQy1wa99bwxmb1jZur2tdEzdLdWs417AN7k/K0PnwhTHEQvNYGUlLre2zTpu6b4iPSrlua MnKzVgdP qJ+QoZb3Wkb9OPDxGh94Vuo49QQ1FI59Iy6chqcodMNWvbL/lEhUJVpLxlTxrHkIaebrKB8pLyzoDowOpQaar4SQ94mhdb9fsN0qYZBOgjVHTLt86qgqoOLcaVqZp7Ww32z+nEuf86mimWPTf2SSiagpWLXCN4K3UJWtuBtsmWLSaM+XVflKRmLV02GIAbZPhebeo7M6VEYqUZrIRVBMJT9ilrRzo+sGpuFGSc4EPET8pssqGc+BtMhqL0iLy9mJMh21kF4GjztgVOQf83sALBTN1TXR5Ob/EcbsvYOD5LUTNRJAXCu/GO9ynYreuPL0nIshlGLM4ecrgFvmucjMSSPT3bUIuqvNDsOTHPavqH1ViUnY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Remove the following warnings by removing unused argc and argv parameters: In function ‘main’: warning: unused parameter ‘argc’ [-Wunused-parameter] 158 | int main(int argc, char *argv[]) | ~~~~^~~~ warning: unused parameter ‘argv’ [-Wunused-parameter] 158 | int main(int argc, char *argv[]) | ~~~~~~^~~~~~ Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/compaction_test.c | 2 +- tools/testing/selftests/mm/cow.c | 2 +- tools/testing/selftests/mm/droppable.c | 2 +- tools/testing/selftests/mm/gup_longterm.c | 2 +- tools/testing/selftests/mm/hugepage-vmemmap.c | 2 +- tools/testing/selftests/mm/hugetlb-madvise.c | 2 +- tools/testing/selftests/mm/hugetlb-soft-offline.c | 2 +- tools/testing/selftests/mm/madv_populate.c | 2 +- tools/testing/selftests/mm/map_populate.c | 2 +- tools/testing/selftests/mm/memfd_secret.c | 2 +- tools/testing/selftests/mm/mlock-random-test.c | 2 +- tools/testing/selftests/mm/mlock2-tests.c | 2 +- tools/testing/selftests/mm/on-fault-limit.c | 2 +- tools/testing/selftests/mm/pkey_sighandler_tests.c | 2 +- tools/testing/selftests/mm/soft-dirty.c | 2 +- tools/testing/selftests/mm/uffd-wp-mremap.c | 2 +- tools/testing/selftests/mm/virtual_address_range.c | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c index 2c3a0eb6b22d3..8d23b698ce9db 100644 --- a/tools/testing/selftests/mm/compaction_test.c +++ b/tools/testing/selftests/mm/compaction_test.c @@ -194,7 +194,7 @@ int set_zero_hugepages(unsigned long *initial_nr_hugepages) return ret; } -int main(int argc, char **argv) +int main(void) { struct rlimit lim; struct map_list *list = NULL, *entry; diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c index 1238e1c5aae15..ea00c85c76caa 100644 --- a/tools/testing/selftests/mm/cow.c +++ b/tools/testing/selftests/mm/cow.c @@ -1769,7 +1769,7 @@ static int tests_per_non_anon_test_case(void) return tests; } -int main(int argc, char **argv) +int main(void) { int err; struct thp_settings default_settings; diff --git a/tools/testing/selftests/mm/droppable.c b/tools/testing/selftests/mm/droppable.c index f3d9ecf96890a..90ea6377810c5 100644 --- a/tools/testing/selftests/mm/droppable.c +++ b/tools/testing/selftests/mm/droppable.c @@ -15,7 +15,7 @@ #include "../kselftest.h" -int main(int argc, char *argv[]) +int main(void) { size_t alloc_size = 134217728; size_t page_size = getpagesize(); diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/selftests/mm/gup_longterm.c index 9423ad439a614..03a31dcb57577 100644 --- a/tools/testing/selftests/mm/gup_longterm.c +++ b/tools/testing/selftests/mm/gup_longterm.c @@ -444,7 +444,7 @@ static int tests_per_test_case(void) return 3 + nr_hugetlbsizes; } -int main(int argc, char **argv) +int main(void) { int i, err; diff --git a/tools/testing/selftests/mm/hugepage-vmemmap.c b/tools/testing/selftests/mm/hugepage-vmemmap.c index df366a4d1b92d..23e97e552057d 100644 --- a/tools/testing/selftests/mm/hugepage-vmemmap.c +++ b/tools/testing/selftests/mm/hugepage-vmemmap.c @@ -87,7 +87,7 @@ static int check_page_flags(unsigned long pfn) return 0; } -int main(int argc, char **argv) +int main(void) { void *addr; unsigned long pfn; diff --git a/tools/testing/selftests/mm/hugetlb-madvise.c b/tools/testing/selftests/mm/hugetlb-madvise.c index e74107185324f..43f16c12c8e9a 100644 --- a/tools/testing/selftests/mm/hugetlb-madvise.c +++ b/tools/testing/selftests/mm/hugetlb-madvise.c @@ -58,7 +58,7 @@ void read_fault_pages(void *addr, unsigned long nr_pages) } } -int main(int argc, char **argv) +int main(int __attribute__((unused)) argc, char **argv) { unsigned long free_hugepages; void *addr, *addr2; diff --git a/tools/testing/selftests/mm/hugetlb-soft-offline.c b/tools/testing/selftests/mm/hugetlb-soft-offline.c index f086f0e04756f..cb087303f5ed3 100644 --- a/tools/testing/selftests/mm/hugetlb-soft-offline.c +++ b/tools/testing/selftests/mm/hugetlb-soft-offline.c @@ -216,7 +216,7 @@ static void test_soft_offline_common(int enable_soft_offline) enable_soft_offline); } -int main(int argc, char **argv) +int main(void) { ksft_print_header(); ksft_set_plan(2); diff --git a/tools/testing/selftests/mm/madv_populate.c b/tools/testing/selftests/mm/madv_populate.c index ef7d911da13e0..c6a3ee56a54a9 100644 --- a/tools/testing/selftests/mm/madv_populate.c +++ b/tools/testing/selftests/mm/madv_populate.c @@ -281,7 +281,7 @@ static int system_has_softdirty(void) #endif } -int main(int argc, char **argv) +int main(void) { int nr_tests = 16; int err; diff --git a/tools/testing/selftests/mm/map_populate.c b/tools/testing/selftests/mm/map_populate.c index 5c8a53869b1bd..0dd849b4affa6 100644 --- a/tools/testing/selftests/mm/map_populate.c +++ b/tools/testing/selftests/mm/map_populate.c @@ -74,7 +74,7 @@ static int child_f(int sock, unsigned long *smap, int fd) return ksft_cnt.ksft_pass; } -int main(int argc, char **argv) +int main(void) { int sock[2], child, ret; FILE *ftmp; diff --git a/tools/testing/selftests/mm/memfd_secret.c b/tools/testing/selftests/mm/memfd_secret.c index 74c911aa3aea9..b9659fa357371 100644 --- a/tools/testing/selftests/mm/memfd_secret.c +++ b/tools/testing/selftests/mm/memfd_secret.c @@ -297,7 +297,7 @@ static void prepare(void) #define NUM_TESTS 6 -int main(int argc, char *argv[]) +int main(void) { int fd; diff --git a/tools/testing/selftests/mm/mlock-random-test.c b/tools/testing/selftests/mm/mlock-random-test.c index 1cd80b0f76c33..0d95d630d0450 100644 --- a/tools/testing/selftests/mm/mlock-random-test.c +++ b/tools/testing/selftests/mm/mlock-random-test.c @@ -236,7 +236,7 @@ static void test_mlock_outof_limit(char *p, int alloc_size) ksft_test_result_pass("%s\n", __func__); } -int main(int argc, char **argv) +int main(void) { char *p = NULL; diff --git a/tools/testing/selftests/mm/mlock2-tests.c b/tools/testing/selftests/mm/mlock2-tests.c index 7f0d50fa361dc..358711e8191f7 100644 --- a/tools/testing/selftests/mm/mlock2-tests.c +++ b/tools/testing/selftests/mm/mlock2-tests.c @@ -425,7 +425,7 @@ static void test_mlockall(void) munlockall(); } -int main(int argc, char **argv) +int main(void) { int ret, size = 3 * getpagesize(); void *map; diff --git a/tools/testing/selftests/mm/on-fault-limit.c b/tools/testing/selftests/mm/on-fault-limit.c index 431c1277d83a1..ade160966c926 100644 --- a/tools/testing/selftests/mm/on-fault-limit.c +++ b/tools/testing/selftests/mm/on-fault-limit.c @@ -28,7 +28,7 @@ static void test_limit(void) munlockall(); } -int main(int argc, char **argv) +int main(void) { ksft_print_header(); ksft_set_plan(1); diff --git a/tools/testing/selftests/mm/pkey_sighandler_tests.c b/tools/testing/selftests/mm/pkey_sighandler_tests.c index 1ac8c88098807..249989f8b7a2a 100644 --- a/tools/testing/selftests/mm/pkey_sighandler_tests.c +++ b/tools/testing/selftests/mm/pkey_sighandler_tests.c @@ -528,7 +528,7 @@ static void (*pkey_tests[])(void) = { test_pkru_sigreturn }; -int main(int argc, char *argv[]) +int main(void) { int i; diff --git a/tools/testing/selftests/mm/soft-dirty.c b/tools/testing/selftests/mm/soft-dirty.c index 8e1462ce05326..7286c90fff1a3 100644 --- a/tools/testing/selftests/mm/soft-dirty.c +++ b/tools/testing/selftests/mm/soft-dirty.c @@ -187,7 +187,7 @@ static void test_mprotect_file(int pagemap_fd, int pagesize) test_mprotect(pagemap_fd, pagesize, false); } -int main(int argc, char **argv) +int main(void) { int pagemap_fd; int pagesize; diff --git a/tools/testing/selftests/mm/uffd-wp-mremap.c b/tools/testing/selftests/mm/uffd-wp-mremap.c index 2c4f984bd73ca..f548b1e1f197c 100644 --- a/tools/testing/selftests/mm/uffd-wp-mremap.c +++ b/tools/testing/selftests/mm/uffd-wp-mremap.c @@ -331,7 +331,7 @@ static const struct testcase testcases[] = { }, }; -int main(int argc, char **argv) +int main(void) { struct thp_settings settings; int i, j, plan = 0; diff --git a/tools/testing/selftests/mm/virtual_address_range.c b/tools/testing/selftests/mm/virtual_address_range.c index 4042fd878acd7..7993583450766 100644 --- a/tools/testing/selftests/mm/virtual_address_range.c +++ b/tools/testing/selftests/mm/virtual_address_range.c @@ -158,7 +158,7 @@ static int validate_complete_va_space(void) return 0; } -int main(int argc, char *argv[]) +int main(void) { char *ptr[NR_CHUNKS_LOW]; char **hptr; From patchwork Thu Jan 9 17:38:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933050 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 119E1E77197 for ; Thu, 9 Jan 2025 17:39:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D85F6B008C; Thu, 9 Jan 2025 12:39:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9881C6B0092; Thu, 9 Jan 2025 12:39:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 828E26B0093; Thu, 9 Jan 2025 12:39:16 -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 59F4A6B008C for ; Thu, 9 Jan 2025 12:39:16 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 05DD2A0325 for ; Thu, 9 Jan 2025 17:39:16 +0000 (UTC) X-FDA: 82988624712.29.ADB39BF Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf23.hostedemail.com (Postfix) with ESMTP id 1F42114000A for ; Thu, 9 Jan 2025 17:39:13 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=fUDKglXD; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf23.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444354; a=rsa-sha256; cv=pass; b=SRf/JgQu5z7mjghEhD+QM7ar+Pnw1pmpcjzjvc9HwBkf0iJZGOBKttwFpqnctrVLWZDHms KbybQQcYh4JkiN1CrbjIWgwrMv9CGddSAiGVOyUy1kaDptQXhTyydWurkXgH5XTUVWXkAt V4wBM6hoUgOn0X+QeQK+0m+DU+DueSc= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=fUDKglXD; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf23.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736444354; 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:in-reply-to:references:references:dkim-signature; bh=DzeP1877WvjEGBYELRWDa1Fo4chfHCz216EXXV975qM=; b=HQharL+dAkzv/70BEI8/RoAIJHQz5jhHffG4AYHNlcCMqjBOJxbq44ainO5VLfFcNoIU3f uufJwMss7rpM37wca16oXMNlzkhDsBT7sy9cx6NLCBEqDDBPN+aeLf/sd+t88aw4rSPYki /JAUW4tuS91YAKVSolYPCFR1aZQrMjY= ARC-Seal: i=1; a=rsa-sha256; t=1736444339; cv=none; d=zohomail.com; s=zohoarc; b=ONu17u81hOmHOabYuB7sMpw1Vkpsu1s65oTy1JfJV+QRkxuPt50f0dbR5rDyNYUVb+qf/cRjspjdzI0zDY//e7yTCw3UaJzi7y6ODpU4KBlvitpN40Q2VjFhQIuLKGxDLOLQuLhuumz77PHcoTdG0n4Y3vBK4A4N3QWMB4yZq7A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444339; h=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=DzeP1877WvjEGBYELRWDa1Fo4chfHCz216EXXV975qM=; b=ehDzb7K7x7wR+E8C8fcj/0RDoPZSq67n/5OXDJZZIl9NCMdc8+FiRgBGhfmer06UvAPC/WT7sSh5djPdNbFxE4Mwwnx2jo7toLyrTd7sO/iqDno+wVND/2dDB94GdkZnIl+1cw0H0qkJnyLjx5eUeoEch6/4o/bNNzq/Lcew0PA= 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=1736444339; 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-Transfer-Encoding:Reply-To; bh=DzeP1877WvjEGBYELRWDa1Fo4chfHCz216EXXV975qM=; b=fUDKglXDNAM9KS8TprA2p9ApBzZJTjzC6r9wIKwdKWwIbuOwSfuNFiSZ0BB7oLiU PBZmE1SXg13PK3WHAH+NWsmHhMq1KZRuSmLoJea1jGOnQYD2eePoJ6KZcWs5hJRhuG6 nifnuw97bvY8qRqRl4jdsNYKE0MhPzQIHrZWLnYY= Received: by mx.zohomail.com with SMTPS id 1736444336977345.11679082868227; Thu, 9 Jan 2025 09:38:56 -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 02/16] selftests/mm: Fix unused parameter warnings Date: Thu, 9 Jan 2025 22:38:28 +0500 Message-Id: <20250109173842.1142376-3-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-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 1F42114000A X-Stat-Signature: bn81me6k8ba9rngne98t91sotkd3iaqu X-HE-Tag: 1736444353-995167 X-HE-Meta: U2FsdGVkX18S3nGrwrWOAm2NF+t20XV8sxTCZz4urhwnLRdWqqCZ17VVA5nmIYzo3LmX9mBQYn+yxyszspQTkHy6o6mQtqGf3xMUv64b+LNzKfG/WjnBSsPFJZhmvRt8/Ct0hZj7oqNSVPPBZGxjKyExiLOBAjqQtDk3U7d3nKFpdcHpZojNi6F0aGX0ee+8fTjF5e5RW7tz6W+zUIuv4V9UEL3ZmuJ+GBf0BTwclyYjZse/AwaX1r1dH3OugSRaCtaBPdaEWXgOXDSDPV9q/79izvz37vRfHmo4xC6l7JG2oCVurnIDt2OhhpQmMuYWS1Mm0w2ZnsD8MWwNn5yjFZy28PB1bSnz/aAXSUn9qU2Pk9WkIXzTSKW69qEVsnTcvXPaW1dyGw0jhslfDVfiK+EoqwjBEygsSW+N3389z4HiGWvEOatLNACAt6xph0/3i6hdhdC5HwaOaMMQTlddsf/3gQ5dWE9sCkxmzWAlteWgUFNV9m/7Wc8StgHZlaFVG3O7lD773c6xs8ABd51K5TAHMkmk+3ey79M3Kp1gXDQc3jX/jnmra6XEXHh0p6UJKnhKG/+p0v4/PE5+P7c2W2eSv8XQX4QxCaHnSWAUiRK8zKlFI9FVxtfNxoaWgPsFfs8AbjyqAzlt8P2ni//3i8mDLZTaHsocgFbCq8quhIDl6L9Z+L7mWJb4IneN3T6oa9925pTtfhsn/c2P/4WGyZcrL79R4RY0bJMIv05Laq46bZaAC3ImZBGum48k6/FR9P7cx76DqvZsxxxKKP2+O0ijXG5yHSfuTW7fRk7PmmJ/BZjT3yrJf6Ny2TAewhetluoxsr4omzvpzkFyAo1w7lmtHHZ64QOrfztLSJJnRxWGG6tag61+NySzuNkn8WsUeuy2s4BBgRYgiVLOkRaULwXztmtv2tGFC/0yNyHzzpYbAMTk9U3J9MEecH83MN2ezuhApBhDJ3uzUZvZfAs glLIGw+7 OgTNgf12mCbU50AWhFBVbmaC0n9SipA6Bo1izR2v57OIlojf73R6boU0RsUXtNgdgLJGR6TfbAAHyhWAniEcDuNlKAdsaGTAq+qUFtNeSBxmA7OdW/Il5tsfPbobSHFdmC9xS8R8m9eO/wa9nonuc5n/W4KIyWpCgagADwZaXcK8eYK1sCapToU2YARsoFGvIfdITZQFNKV0sPWXyYxb1FVwkxhhNgGCBxsrNuvYyTgrTmDUgS6CuUSO+s7wXvp/kJk7fXQoqWgUuZqWc7HGwzWadGJOA8pj2DKc9jB+9Vtb8kL6jTuOIHXIUe6hwNsrO8feF 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 warnings generated by unused parameters. Signed-off-by: Muhammad Usama Anjum --- .../selftests/mm/hugetlb_fault_after_madv.c | 4 +- .../selftests/mm/hugetlb_madv_vs_map.c | 6 +-- tools/testing/selftests/mm/ksm_tests.c | 17 +++--- tools/testing/selftests/mm/memfd_secret.c | 4 +- tools/testing/selftests/mm/soft-dirty.c | 4 +- .../selftests/mm/split_huge_page_test.c | 4 +- tools/testing/selftests/mm/uffd-common.c | 18 ++++--- tools/testing/selftests/mm/uffd-common.h | 2 +- tools/testing/selftests/mm/uffd-stress.c | 2 +- tools/testing/selftests/mm/uffd-unit-tests.c | 52 +++++++++---------- 10 files changed, 57 insertions(+), 56 deletions(-) diff --git a/tools/testing/selftests/mm/hugetlb_fault_after_madv.c b/tools/testing/selftests/mm/hugetlb_fault_after_madv.c index e2640529dbb29..e62f4e1388f26 100644 --- a/tools/testing/selftests/mm/hugetlb_fault_after_madv.c +++ b/tools/testing/selftests/mm/hugetlb_fault_after_madv.c @@ -28,7 +28,7 @@ static void signal_handler(int signal) } /* Touch the memory while it is being madvised() */ -void *touch(void *unused) +void *touch(void __attribute__((unused)) *unused) { char *ptr = (char *)huge_ptr; @@ -41,7 +41,7 @@ void *touch(void *unused) return NULL; } -void *madv(void *unused) +void *madv(void __attribute__((unused)) *unused) { usleep(rand() % 10); diff --git a/tools/testing/selftests/mm/hugetlb_madv_vs_map.c b/tools/testing/selftests/mm/hugetlb_madv_vs_map.c index 8f122a0f08281..6c326cf3dcf6b 100644 --- a/tools/testing/selftests/mm/hugetlb_madv_vs_map.c +++ b/tools/testing/selftests/mm/hugetlb_madv_vs_map.c @@ -33,7 +33,7 @@ size_t mmap_size; char *huge_ptr; /* Touch the memory while it is being madvised() */ -void *touch(void *unused) +void *touch(void __attribute__((unused)) *unused) { for (int i = 0; i < INLOOP_ITER; i++) huge_ptr[0] = '.'; @@ -41,7 +41,7 @@ void *touch(void *unused) return NULL; } -void *madv(void *unused) +void *madv(void __attribute__((unused)) *unused) { for (int i = 0; i < INLOOP_ITER; i++) madvise(huge_ptr, mmap_size, MADV_DONTNEED); @@ -54,7 +54,7 @@ void *madv(void *unused) * The other hugepage should be flipping from used <-> reserved, because * of madvise(DONTNEED). */ -void *map_extra(void *unused) +void *map_extra(void __attribute__((unused)) *unused) { void *ptr; diff --git a/tools/testing/selftests/mm/ksm_tests.c b/tools/testing/selftests/mm/ksm_tests.c index dcdd5bb20f3d8..323cfcb14e4d4 100644 --- a/tools/testing/selftests/mm/ksm_tests.c +++ b/tools/testing/selftests/mm/ksm_tests.c @@ -265,8 +265,7 @@ static int ksm_merge_pages(int merge_type, void *addr, size_t size, return 0; } -static int ksm_unmerge_pages(void *addr, size_t size, - struct timespec start_time, int timeout) +static int ksm_unmerge_pages(void *addr, size_t size) { if (madvise(addr, size, MADV_UNMERGEABLE)) { perror("madvise"); @@ -483,7 +482,7 @@ static int get_first_mem_node(void) return get_next_mem_node(numa_max_node()); } -static int check_ksm_numa_merge(int merge_type, int mapping, int prot, int timeout, +static int check_ksm_numa_merge(int merge_type, int timeout, bool merge_across_nodes, size_t page_size) { void *numa1_map_ptr, *numa2_map_ptr; @@ -547,8 +546,7 @@ static int check_ksm_numa_merge(int merge_type, int mapping, int prot, int timeo return KSFT_FAIL; } -static int ksm_merge_hugepages_time(int merge_type, int mapping, int prot, - int timeout, size_t map_size) +static int ksm_merge_hugepages_time(int merge_type, int timeout, size_t map_size) { void *map_ptr, *map_ptr_orig; struct timespec start_time, end_time; @@ -678,7 +676,7 @@ static int ksm_unmerge_time(int merge_type, int mapping, int prot, int timeout, perror("clock_gettime"); goto err_out; } - if (ksm_unmerge_pages(map_ptr, map_size, start_time, timeout)) + if (ksm_unmerge_pages(map_ptr, map_size)) goto err_out; if (clock_gettime(CLOCK_MONOTONIC_RAW, &end_time)) { perror("clock_gettime"); @@ -906,8 +904,8 @@ int main(int argc, char *argv[]) page_size); break; case CHECK_KSM_NUMA_MERGE: - ret = check_ksm_numa_merge(merge_type, MAP_PRIVATE | MAP_ANONYMOUS, prot, - ksm_scan_limit_sec, merge_across_nodes, page_size); + ret = check_ksm_numa_merge(merge_type, ksm_scan_limit_sec, merge_across_nodes, + page_size); break; case KSM_MERGE_TIME: if (size_MB == 0) { @@ -922,8 +920,7 @@ int main(int argc, char *argv[]) printf("Option '-s' is required.\n"); return KSFT_FAIL; } - ret = ksm_merge_hugepages_time(merge_type, MAP_PRIVATE | MAP_ANONYMOUS, prot, - ksm_scan_limit_sec, size_MB); + ret = ksm_merge_hugepages_time(merge_type, ksm_scan_limit_sec, size_MB); break; case KSM_UNMERGE_TIME: if (size_MB == 0) { diff --git a/tools/testing/selftests/mm/memfd_secret.c b/tools/testing/selftests/mm/memfd_secret.c index b9659fa357371..f9d728e18678c 100644 --- a/tools/testing/selftests/mm/memfd_secret.c +++ b/tools/testing/selftests/mm/memfd_secret.c @@ -121,7 +121,7 @@ static void test_vmsplice(int fd, const char *desc) close(pipefd[1]); } -static void try_process_vm_read(int fd, int pipefd[2]) +static void try_process_vm_read(int __attribute__((unused)) fd, int pipefd[2]) { struct iovec liov, riov; char buf[64]; @@ -145,7 +145,7 @@ static void try_process_vm_read(int fd, int pipefd[2]) exit(KSFT_FAIL); } -static void try_ptrace(int fd, int pipefd[2]) +static void try_ptrace(int __attribute__((unused)) fd, int pipefd[2]) { pid_t ppid = getppid(); int status; diff --git a/tools/testing/selftests/mm/soft-dirty.c b/tools/testing/selftests/mm/soft-dirty.c index 7286c90fff1a3..b6eb5c4642ce5 100644 --- a/tools/testing/selftests/mm/soft-dirty.c +++ b/tools/testing/selftests/mm/soft-dirty.c @@ -74,7 +74,7 @@ static void test_vma_reuse(int pagemap_fd, int pagesize) munmap(map2, pagesize); } -static void test_hugepage(int pagemap_fd, int pagesize) +static void test_hugepage(int pagemap_fd) { char *map; int i, ret; @@ -203,7 +203,7 @@ int main(void) test_simple(pagemap_fd, pagesize); test_vma_reuse(pagemap_fd, pagesize); - test_hugepage(pagemap_fd, pagesize); + test_hugepage(pagemap_fd); test_mprotect_anon(pagemap_fd, pagesize); test_mprotect_file(pagemap_fd, pagesize); diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index eb6d1b9fc3625..84b1251666aa1 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -103,7 +103,7 @@ static char *allocate_zero_filled_hugepage(size_t len) return result; } -static void verify_rss_anon_split_huge_page_all_zeroes(char *one_page, int nr_hpages, size_t len) +static void verify_rss_anon_split_huge_page_all_zeroes(char *one_page, size_t len) { unsigned long rss_anon_before, rss_anon_after; size_t i; @@ -149,7 +149,7 @@ void split_pmd_zero_pages(void) size_t len = nr_hpages * pmd_pagesize; one_page = allocate_zero_filled_hugepage(len); - verify_rss_anon_split_huge_page_all_zeroes(one_page, nr_hpages, len); + verify_rss_anon_split_huge_page_all_zeroes(one_page, len); printf("Split zero filled huge pages successful\n"); free(one_page); } diff --git a/tools/testing/selftests/mm/uffd-common.c b/tools/testing/selftests/mm/uffd-common.c index 717539eddf987..c15674a60f299 100644 --- a/tools/testing/selftests/mm/uffd-common.c +++ b/tools/testing/selftests/mm/uffd-common.c @@ -46,7 +46,7 @@ static void anon_release_pages(char *rel_area) err("madvise(MADV_DONTNEED) failed"); } -static int anon_allocate_area(void **alloc_area, bool is_src) +static int anon_allocate_area(void **alloc_area, bool __attribute__((unused)) is_src) { *alloc_area = mmap(NULL, nr_pages * page_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); @@ -57,7 +57,9 @@ static int anon_allocate_area(void **alloc_area, bool is_src) return 0; } -static void noop_alias_mapping(__u64 *start, size_t len, unsigned long offset) +static void noop_alias_mapping(__u64 __attribute__((unused)) *start, + size_t __attribute__((unused)) len, + unsigned long __attribute__((unused)) offset) { } @@ -108,7 +110,8 @@ static int hugetlb_allocate_area(void **alloc_area, bool is_src) return 0; } -static void hugetlb_alias_mapping(__u64 *start, size_t len, unsigned long offset) +static void hugetlb_alias_mapping(__u64 *start, size_t __attribute__((unused)) len, + unsigned long offset) { if (!map_shared) return; @@ -167,12 +170,13 @@ static int shmem_allocate_area(void **alloc_area, bool is_src) return 0; } -static void shmem_alias_mapping(__u64 *start, size_t len, unsigned long offset) +static void shmem_alias_mapping(__u64 *start, size_t __attribute__((unused)) len, + unsigned long offset) { *start = (unsigned long)area_dst_alias + offset; } -static void shmem_check_pmd_mapping(void *p, int expect_nr_hpages) +static void shmem_check_pmd_mapping(void __attribute__((unused)) *p, int expect_nr_hpages) { if (!check_huge_shmem(area_dst_alias, expect_nr_hpages, read_pmd_pagesize())) @@ -416,7 +420,7 @@ static void continue_range(int ufd, __u64 start, __u64 len, bool wp) ret, (int64_t) req.mapped); } -int uffd_read_msg(int ufd, struct uffd_msg *msg) +int uffd_read_msg(struct uffd_msg *msg) { int ret = read(uffd, msg, sizeof(*msg)); @@ -537,7 +541,7 @@ void *uffd_poll_thread(void *arg) } if (!(pollfd[0].revents & POLLIN)) err("pollfd[0].revents %d", pollfd[0].revents); - if (uffd_read_msg(uffd, &msg)) + if (uffd_read_msg(&msg)) continue; switch (msg.event) { default: diff --git a/tools/testing/selftests/mm/uffd-common.h b/tools/testing/selftests/mm/uffd-common.h index a70ae10b5f620..4a5d5b37107c7 100644 --- a/tools/testing/selftests/mm/uffd-common.h +++ b/tools/testing/selftests/mm/uffd-common.h @@ -117,7 +117,7 @@ void uffd_stats_report(struct uffd_args *args, int n_cpus); int uffd_test_ctx_init(uint64_t features, const char **errmsg); void uffd_test_ctx_clear(void); int userfaultfd_open(uint64_t *features); -int uffd_read_msg(int ufd, struct uffd_msg *msg); +int uffd_read_msg(struct uffd_msg *msg); void wp_range(int ufd, __u64 start, __u64 len, bool wp); void uffd_handle_page_fault(struct uffd_msg *msg, struct uffd_args *args); int __copy_page(int ufd, unsigned long offset, bool retry, bool wp); diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selftests/mm/uffd-stress.c index a4b83280998ab..1270ff3104cc6 100644 --- a/tools/testing/selftests/mm/uffd-stress.c +++ b/tools/testing/selftests/mm/uffd-stress.c @@ -136,7 +136,7 @@ static void *uffd_read_thread(void *arg) /* from here cancellation is ok */ for (;;) { - if (uffd_read_msg(uffd, &msg)) + if (uffd_read_msg(&msg)) continue; uffd_handle_page_fault(&msg, args); } diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c index 9ff71fa1f9bf0..81b315bedb744 100644 --- a/tools/testing/selftests/mm/uffd-unit-tests.c +++ b/tools/testing/selftests/mm/uffd-unit-tests.c @@ -244,7 +244,7 @@ static void *fork_event_consumer(void *data) ready_for_fork = true; /* Read until a full msg received */ - while (uffd_read_msg(args->parent_uffd, &msg)); + while (uffd_read_msg(&msg)); if (msg.event != UFFD_EVENT_FORK) err("wrong message: %u\n", msg.event); @@ -357,7 +357,7 @@ static int pagemap_test_fork(int uffd, bool with_event, bool test_pin) return result; } -static void uffd_wp_unpopulated_test(uffd_test_args_t *args) +static void uffd_wp_unpopulated_test(uffd_test_args_t __attribute__((unused)) *args) { uint64_t value; int pagemap_fd; @@ -483,8 +483,7 @@ static void uffd_wp_fork_with_event_test(uffd_test_args_t *args) uffd_wp_fork_test_common(args, true); } -static void uffd_wp_fork_pin_test_common(uffd_test_args_t *args, - bool with_event) +static void uffd_wp_fork_pin_test_common(bool with_event) { int pagemap_fd; pin_args pin_args = {}; @@ -535,14 +534,14 @@ static void uffd_wp_fork_pin_test_common(uffd_test_args_t *args, close(pagemap_fd); } -static void uffd_wp_fork_pin_test(uffd_test_args_t *args) +static void uffd_wp_fork_pin_test(uffd_test_args_t __attribute__((unused)) *args) { - uffd_wp_fork_pin_test_common(args, false); + uffd_wp_fork_pin_test_common(false); } -static void uffd_wp_fork_pin_with_event_test(uffd_test_args_t *args) +static void uffd_wp_fork_pin_with_event_test(uffd_test_args_t __attribute__((unused)) *args) { - uffd_wp_fork_pin_test_common(args, true); + uffd_wp_fork_pin_test_common(true); } static void check_memory_contents(char *p) @@ -627,24 +626,25 @@ static void uffd_minor_test_common(bool test_collapse, bool test_wp) uffd_test_pass(); } -void uffd_minor_test(uffd_test_args_t *args) +void uffd_minor_test(uffd_test_args_t __attribute__((unused)) *args) { uffd_minor_test_common(false, false); } -void uffd_minor_wp_test(uffd_test_args_t *args) +void uffd_minor_wp_test(uffd_test_args_t __attribute__((unused)) *args) { uffd_minor_test_common(false, true); } -void uffd_minor_collapse_test(uffd_test_args_t *args) +void uffd_minor_collapse_test(uffd_test_args_t __attribute__((unused)) *args) { uffd_minor_test_common(true, false); } static sigjmp_buf jbuf, *sigbuf; -static void sighndl(int sig, siginfo_t *siginfo, void *ptr) +static void sighndl(int sig, siginfo_t __attribute__((unused)) *siginfo, + void __attribute__((unused)) *ptr) { if (sig == SIGBUS) { if (sigbuf) @@ -820,12 +820,12 @@ static void uffd_sigbus_test_common(bool wp) uffd_test_pass(); } -static void uffd_sigbus_test(uffd_test_args_t *args) +static void uffd_sigbus_test(uffd_test_args_t __attribute__((unused)) *args) { uffd_sigbus_test_common(false); } -static void uffd_sigbus_wp_test(uffd_test_args_t *args) +static void uffd_sigbus_wp_test(uffd_test_args_t __attribute__((unused)) *args) { uffd_sigbus_test_common(true); } @@ -873,12 +873,12 @@ static void uffd_events_test_common(bool wp) uffd_test_pass(); } -static void uffd_events_test(uffd_test_args_t *args) +static void uffd_events_test(uffd_test_args_t __attribute__((unused)) *args) { uffd_events_test_common(false); } -static void uffd_events_wp_test(uffd_test_args_t *args) +static void uffd_events_wp_test(uffd_test_args_t __attribute__((unused)) *args) { uffd_events_test_common(true); } @@ -946,7 +946,7 @@ uffd_register_detect_zeropage(int uffd, void *addr, uint64_t len) } /* exercise UFFDIO_ZEROPAGE */ -static void uffd_zeropage_test(uffd_test_args_t *args) +static void uffd_zeropage_test(uffd_test_args_t __attribute__((unused)) *args) { bool has_zeropage; int i; @@ -1002,7 +1002,7 @@ static void do_uffdio_poison(int uffd, unsigned long offset) } static void uffd_poison_handle_fault( - struct uffd_msg *msg, struct uffd_args *args) + struct uffd_msg *msg, struct uffd_args __attribute__((unused)) *args) { unsigned long offset; @@ -1023,7 +1023,7 @@ static void uffd_poison_handle_fault( do_uffdio_poison(uffd, offset); } -static void uffd_poison_test(uffd_test_args_t *targs) +static void uffd_poison_test(uffd_test_args_t __attribute__((unused)) *targs) { pthread_t uffd_mon; char c; @@ -1114,7 +1114,7 @@ static void uffd_move_pmd_handle_fault(struct uffd_msg *msg, } static void -uffd_move_test_common(uffd_test_args_t *targs, unsigned long chunk_size, +uffd_move_test_common(unsigned long chunk_size, void (*handle_fault)(struct uffd_msg *msg, struct uffd_args *args)) { unsigned long nr; @@ -1206,24 +1206,24 @@ uffd_move_test_common(uffd_test_args_t *targs, unsigned long chunk_size, uffd_test_pass(); } -static void uffd_move_test(uffd_test_args_t *targs) +static void uffd_move_test(uffd_test_args_t __attribute__((unused)) *targs) { - uffd_move_test_common(targs, page_size, uffd_move_handle_fault); + uffd_move_test_common(page_size, uffd_move_handle_fault); } -static void uffd_move_pmd_test(uffd_test_args_t *targs) +static void uffd_move_pmd_test(uffd_test_args_t __attribute__((unused)) *targs) { if (madvise(area_dst, nr_pages * page_size, MADV_HUGEPAGE)) err("madvise(MADV_HUGEPAGE) failure"); - uffd_move_test_common(targs, read_pmd_pagesize(), + uffd_move_test_common(read_pmd_pagesize(), uffd_move_pmd_handle_fault); } -static void uffd_move_pmd_split_test(uffd_test_args_t *targs) +static void uffd_move_pmd_split_test(uffd_test_args_t __attribute__((unused)) *targs) { if (madvise(area_dst, nr_pages * page_size, MADV_NOHUGEPAGE)) err("madvise(MADV_NOHUGEPAGE) failure"); - uffd_move_test_common(targs, read_pmd_pagesize(), + uffd_move_test_common(read_pmd_pagesize(), uffd_move_pmd_handle_fault); } From patchwork Thu Jan 9 17:38:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933051 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 8F7DFE77197 for ; Thu, 9 Jan 2025 17:39:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2AC366B0093; Thu, 9 Jan 2025 12:39:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 25D006B0095; Thu, 9 Jan 2025 12:39:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D7346B0096; Thu, 9 Jan 2025 12:39:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id DD0A06B0093 for ; Thu, 9 Jan 2025 12:39:20 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A26BBAE9B4 for ; Thu, 9 Jan 2025 17:39:20 +0000 (UTC) X-FDA: 82988624880.05.1875423 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf20.hostedemail.com (Postfix) with ESMTP id DDCFA1C0015 for ; Thu, 9 Jan 2025 17:39:18 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=RxGbR76O; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf20.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444359; a=rsa-sha256; cv=pass; b=WVtpMxtgkPv1VJR0X/DP/09waVyxOpBZR/R2Kf/p267sTXNrt3jJ71sP2Z+hQM1CsvEtpm Zfw0atAbnkW6t7tOmb3sVk4VkDBJ6qv4w66C2A8LwF1t8s6LVN8SZAW4d4yLE0/FjDB2f6 X7H39jCJ4kUlpyV9MvUBus66X0JMUig= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=RxGbR76O; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf20.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736444359; 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:in-reply-to:references:references:dkim-signature; bh=wQRYp4NaHn6qZOxrq/QHoWxtMXxEn9kcEYhJcS6nYa8=; b=F1DZDnBMXAMZ/VyNHlcVb1YLR6bQiTjeFfc8/kpBtOdqk81yUns86zVRPU4IdeYjYsMEsD UgBslo+X/xvSdIodlRP4wJmmheA94XC69JfO5NFbXapz8fI3Mqzv1aJKRfMuH9j2hLZoat GXguwT5LDk4dZKmTDjj8GHBZ7W+gAg8= ARC-Seal: i=1; a=rsa-sha256; t=1736444343; cv=none; d=zohomail.com; s=zohoarc; b=YklJUeOzj8JLFJvKWPF881sglOIFJXR/Q94B968H/0eeoGYOud4eIIN43wmKOd9xvXbOYLxDSsf1kDv0Od7q6rida9iSBfoi5pg9j8p7qYmJIED4xDz9D6PhWP62wenRv+iKnv6/W7eN+uS/AG8E6Qj/FQ18GaVR0sEel6TvYPY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444343; h=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=wQRYp4NaHn6qZOxrq/QHoWxtMXxEn9kcEYhJcS6nYa8=; b=lfOS/OsurKC7ZWxEKVxVBdOLaFCA/fAFKIC/MgdmBrsmd9CSD9axohcszYu2ZLCYNZrdT55CkuYrtMzZNa9bXhZ/aSPfaC+yOCxZOPn7MyZzkTx1mzXJapx48JiscJgGxhp6p/VD39HRthQAkx0SiH/SHe0bE+ErD1xDWP2H5yk= 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=1736444343; 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-Transfer-Encoding:Reply-To; bh=wQRYp4NaHn6qZOxrq/QHoWxtMXxEn9kcEYhJcS6nYa8=; b=RxGbR76OTIUSMV5K6a1KOXlhEkaEYHu+EO7eJCjD4eZaFD+kti0SnJ9nfBh/X/fO vgyqep6C/rnHMyohN+Byz2GqbckBRV6dsgG3Cqxk3AzTxECG847KiAswzj+nfUCuR4/ HGeeGDzUTX4gMEQk5D5hHzETlANo1wrKfD5PytQQ= Received: by mx.zohomail.com with SMTPS id 1736444341790884.6842476868715; Thu, 9 Jan 2025 09:39:01 -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 03/16] selftests/mm: Fix unused parameter warnings Date: Thu, 9 Jan 2025 22:38:29 +0500 Message-Id: <20250109173842.1142376-4-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-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: DDCFA1C0015 X-Stat-Signature: ya3m8gsgpkfbhoy67cxfjyj4i38f5tez X-HE-Tag: 1736444358-717496 X-HE-Meta: U2FsdGVkX1/Y79EWYV950yvV0jGZStspDjcWtmX4/R+CJj0hXOJpchTEL7K39+BsEJhTgvfeP3Wz170jh1Ps4d+zGoi+lSl2l+0zj7eHl7TbPQQhTxYpP2LAwDIdkcONkrCZLA7+Qv8+JjO+dQdkdii0t1a3yfA/9dQewYBeCbpJjt9oGOUfoDK1VImCjKHTo7jFFDnfeaIyWVL+mm4ah6Ut420ZbVry+BfhBrynEbk7DD1fl58B+Uf22qYivrrRlMAOz6rjOS9iDCRD0uJ9eXG+kH9SBNpZ2y9nbdJ6PUaKel6uWaD7IGX5sG2HNCb2pOQ0w96lDN5kzniCbIBp2nTJPh5vRNzrF9sR44SbdvB10v8ookYyFJDN9sGwUCgJe5QZxcMRr4MeawEzGIm4QB8lBQuzHtdayGchfyKVmQrr52i7JjalWArnn/r6QHyiuSZwWiUmzharz3DlAzPSfWuqHvsP1UZ0N/B+l/85kzRbs8cGilhy/ymBE56FzqFCVFSQ3aqysRGhcSEl2h4i/j9AtbNM3FB+X7/hzkx85/JAeuxIsJ+8sJsBzTehi5MPIhfEtV8M+SRRFNDmELTO8kl/GURZtjpBjaXxXzoO8DJBS5xLAseJq8EYbq3z0HFwhu1LdJBcghzTyIyIEsI8viEhqriQRyZsFU2WZ/yYB2TvTcPlFaY5+blA6FRk3b1Iva8GyTC3r9ystzixfpP7bykG69oqCdsPPdZP/IckCDT91OHzI73vGOamJSKpThr9GtXohXtIrt/RYkvNxgLHlBDZ4pSHsAhl7Jha6AkZWIAp5rwsGEGXRHm2WPmE3p61byPrZcHe6Z6DmE3Cn91dp9xwxvvVrc+oNh1nLq4OfSMX8/cHWM9grS16wo7g8W4NlAC9kyQGruETdxI6LtGniZhKi+Sdvf/e3lR2j2ndi2O9/JM5KHob3YMsthgW68UCLavcYqy7woFx9jbcHff AmLKRgtQ u10SvhzyjnW2GJkYnEUqsyJyHw1g1M7c/Ug6kCS+Q34wOreACdJIG4OMZQ94bZPKIzaMedpm+0yiD5MllC0SnMiN49w+cz70PGl36srhF2yWn3LMrurR0GrvKrIQy1uWSdopgLK+L5FloBrfZYJsL1ZUb8mQTtWeAuFoDPgjlByaNegA2WMSQO/GALgi+D/4RSpuwbwFR3S5GQ4jX9xi3BWEeOGh0OYtrySAYOwYTEFXOETSCCinaRJqgDeUHHrHHxmVAJ6MYNwXxQxUqse2R92iftmwYp/6cSB66KwcrulNhrG3JuWJfM4O0f+H+Y3FDqEfJ 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 unused parameter warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pkey-x86.h | 4 +++- .../selftests/mm/pkey_sighandler_tests.c | 17 +++++++++++------ tools/testing/selftests/mm/protection_keys.c | 18 ++++++++++-------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/tools/testing/selftests/mm/pkey-x86.h b/tools/testing/selftests/mm/pkey-x86.h index f7ecd335df1e6..75cef8ee00702 100644 --- a/tools/testing/selftests/mm/pkey-x86.h +++ b/tools/testing/selftests/mm/pkey-x86.h @@ -157,7 +157,9 @@ static inline void expect_fault_on_read_execonly_key(void *p1, int pkey) expected_pkey_fault(pkey); } -static inline void *malloc_pkey_with_mprotect_subpage(long size, int prot, u16 pkey) +static inline void *malloc_pkey_with_mprotect_subpage(long __attribute__((unused)) size, + int __attribute__((unused)) prot, + u16 __attribute__((unused)) pkey) { return PTR_ERR_ENOTSUP; } diff --git a/tools/testing/selftests/mm/pkey_sighandler_tests.c b/tools/testing/selftests/mm/pkey_sighandler_tests.c index 249989f8b7a2a..cd46528d6c215 100644 --- a/tools/testing/selftests/mm/pkey_sighandler_tests.c +++ b/tools/testing/selftests/mm/pkey_sighandler_tests.c @@ -42,7 +42,8 @@ static siginfo_t siginfo = {0}; * which is protected by MPK 0 which we don't have access to. */ static inline __always_inline -long syscall_raw(long n, long a1, long a2, long a3, long a4, long a5, long a6) +long syscall_raw(long n, long a1, long a2, long a3, long a4, long a5, + long __attribute__((unused)) a6) { unsigned long ret; #ifdef __x86_64__ @@ -110,7 +111,8 @@ static inline u64 pkey_reg_restrictive_default(void) return set_pkey_bits(PKEY_REG_ALLOW_NONE, 0, PKEY_DISABLE_ACCESS); } -static void sigsegv_handler(int signo, siginfo_t *info, void *ucontext) +static void sigsegv_handler(int __attribute__((unused)) signo, siginfo_t *info, + void __attribute__((unused)) *ucontext) { pthread_mutex_lock(&mutex); @@ -122,7 +124,8 @@ static void sigsegv_handler(int signo, siginfo_t *info, void *ucontext) syscall_raw(SYS_exit, 0, 0, 0, 0, 0, 0); } -static void sigusr1_handler(int signo, siginfo_t *info, void *ucontext) +static void sigusr1_handler(int __attribute__((unused)) signo, siginfo_t *info, + void __attribute__((unused)) *ucontext) { pthread_mutex_lock(&mutex); @@ -132,7 +135,9 @@ static void sigusr1_handler(int signo, siginfo_t *info, void *ucontext) pthread_mutex_unlock(&mutex); } -static void sigusr2_handler(int signo, siginfo_t *info, void *ucontext) +static void sigusr2_handler(int __attribute__((unused)) signo, + siginfo_t __attribute__((unused)) *info, + void __attribute__((unused)) *ucontext) { /* * pkru should be the init_pkru value which enabled MPK 0 so @@ -155,7 +160,7 @@ static void raise_sigusr2(void) */ } -static void *thread_segv_with_pkey0_disabled(void *ptr) +static void *thread_segv_with_pkey0_disabled(void __attribute__((unused)) *ptr) { /* Disable MPK 0 (and all others too) */ __write_pkey_reg(pkey_reg_restrictive_default()); @@ -165,7 +170,7 @@ static void *thread_segv_with_pkey0_disabled(void *ptr) return NULL; } -static void *thread_segv_pkuerr_stack(void *ptr) +static void *thread_segv_pkuerr_stack(void __attribute__((unused)) *ptr) { /* Disable MPK 0 (and all others too) */ __write_pkey_reg(pkey_reg_restrictive_default()); diff --git a/tools/testing/selftests/mm/protection_keys.c b/tools/testing/selftests/mm/protection_keys.c index a4683f2476f27..3a66798a8e8d6 100644 --- a/tools/testing/selftests/mm/protection_keys.c +++ b/tools/testing/selftests/mm/protection_keys.c @@ -309,7 +309,7 @@ static char *si_code_str(int si_code) static int pkey_faults; static int last_si_pkey = -1; -static void signal_handler(int signum, siginfo_t *si, void *vucontext) +static void signal_handler(int __attribute__((unused)) signum, siginfo_t *si, void *vucontext) { ucontext_t *uctxt = vucontext; int trapno; @@ -891,7 +891,7 @@ static void close_test_fds(void) nr_test_fds = 0; } -static void test_pkey_alloc_free_attach_pkey0(int *ptr, u16 pkey) +static void test_pkey_alloc_free_attach_pkey0(int *ptr, u16 __attribute__((unused)) pkey) { int i, err; int max_nr_pkey_allocs; @@ -1108,7 +1108,7 @@ static void test_pkey_syscalls_on_non_allocated_pkey(int *ptr, u16 pkey) } /* Assumes that all pkeys other than 'pkey' are unallocated */ -static void test_pkey_syscalls_bad_args(int *ptr, u16 pkey) +static void test_pkey_syscalls_bad_args(int *ptr, u16 __attribute__((unused)) pkey) { int err; int bad_pkey = NR_PKEYS+99; @@ -1134,7 +1134,7 @@ static void become_child(void) } /* Assumes that all pkeys other than 'pkey' are unallocated */ -static void test_pkey_alloc_exhaust(int *ptr, u16 pkey) +static void test_pkey_alloc_exhaust(int __attribute__((unused)) *ptr, u16 __attribute__((unused)) pkey) { int err; int allocated_pkeys[NR_PKEYS] = {0}; @@ -1240,7 +1240,7 @@ static void arch_force_pkey_reg_init(void) * a long-running test that continually checks the pkey * register. */ -static void test_pkey_init_state(int *ptr, u16 pkey) +static void test_pkey_init_state(int __attribute__((unused)) *ptr, u16 __attribute__((unused)) pkey) { int err; int allocated_pkeys[NR_PKEYS] = {0}; @@ -1399,7 +1399,7 @@ static void *get_pointer_to_instructions(void) return p1; } -static void test_executing_on_unreadable_memory(int *ptr, u16 pkey) +static void test_executing_on_unreadable_memory(int __attribute__((unused)) *ptr, u16 pkey) { void *p1; int scratch; @@ -1431,7 +1431,8 @@ static void test_executing_on_unreadable_memory(int *ptr, u16 pkey) pkey_assert(!ret); } -static void test_implicit_mprotect_exec_only_memory(int *ptr, u16 pkey) +static void test_implicit_mprotect_exec_only_memory(int __attribute__((unused)) *ptr, + u16 __attribute__((unused)) pkey) { void *p1; int scratch; @@ -1480,7 +1481,8 @@ static void test_implicit_mprotect_exec_only_memory(int *ptr, u16 pkey) } #if defined(__i386__) || defined(__x86_64__) -static void test_ptrace_modifies_pkru(int *ptr, u16 pkey) +static void test_ptrace_modifies_pkru(int __attribute__((unused)) *ptr, + u16 __attribute__((unused)) pkey) { u32 new_pkru; pid_t child; From patchwork Thu Jan 9 17:38:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933052 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 ECD9EE77197 for ; Thu, 9 Jan 2025 17:39:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7B4FA6B0096; Thu, 9 Jan 2025 12:39:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7651A6B0098; Thu, 9 Jan 2025 12:39:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 605F06B0099; Thu, 9 Jan 2025 12:39:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 42BCD6B0096 for ; Thu, 9 Jan 2025 12:39:26 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 05594802AF for ; Thu, 9 Jan 2025 17:39:26 +0000 (UTC) X-FDA: 82988625132.10.88F8D19 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf05.hostedemail.com (Postfix) with ESMTP id 31E9F100010 for ; Thu, 9 Jan 2025 17:39:23 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=jZBwCQLG; dmarc=pass (policy=none) header.from=collabora.com; spf=pass (imf05.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") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736444364; 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:in-reply-to:references:references:dkim-signature; bh=eJgiI6Vx5zFOc8jFmmCKCG1szUd46kqPcPMGhbEUP04=; b=FfCMmfLHUKw/3i9q9hwNX/nOxMXOaGff8ZxyMdkP8Z6YtIDlJSGokt8b3syLoLREp5RkMJ ZS2yeehtaFGmorX2dO5/r3QOS8WyuxlU97kkt+06CZyYR8jajIoDVP5yvHV6vYd75gmAip NpRuItq4aPPT8dNQ/307HiIA3YESUi4= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444364; a=rsa-sha256; cv=pass; b=tPihVMbeMgyi68U/l3nNTmY/p2dy6j4hWzrDBs5btyC8aQ5iTy0C0IqOFTjMbxPQjcNXDy wiqKYlIYjL8n2vIymxbv7NWskSyVkx7bTbdGfsrzyFSmSN6uldmRdFpZLsTDm+GjS5Yw+h YvWT1dvN0WiNtYgSG9oJERRNB5otigI= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=jZBwCQLG; dmarc=pass (policy=none) header.from=collabora.com; spf=pass (imf05.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") ARC-Seal: i=1; a=rsa-sha256; t=1736444349; cv=none; d=zohomail.com; s=zohoarc; b=HHkqer9D9jOpYsHxWEyHRpi13jplxxgtYJDH71wMARrdu73i7SG/Bwa2BnWYvhh5j1T1bDGGM81c+M8H/isTROi8mXFAjDjAcTAYH6c4CNY+OTAd62wZ44V26E/4wGjzIsGQmtCvxQuldUR0wUEVcGloHhwKuiD+P0ZstplSFrU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444349; h=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=eJgiI6Vx5zFOc8jFmmCKCG1szUd46kqPcPMGhbEUP04=; b=NEs77iCxdncBgju4MXnwU0ozZeijflfvDge8zUAoe5UCgkq1X3PSJQUpglLYwQD/8l44guCeHnXLzSiJeSg7PBR0VhgPrYur2w+Z4PynY317ysyW/2ytmRnnNNGC+xTmCXeSwGqVwvU2sDh+7tuUqyaTyjk8V8xQLSd5UoQsTnA= 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=1736444349; 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-Transfer-Encoding:Reply-To; bh=eJgiI6Vx5zFOc8jFmmCKCG1szUd46kqPcPMGhbEUP04=; b=jZBwCQLGCsVNAzEP5uALr00gMia10ZsyrVMFVizansqMMAt9eckT3AfdkjHHKlWi 0uFx9Fbnehzcxvk4GpExok1AWpkkYgfEBO+UzhhOjZxdeyZOnmuObiTXT/kP2miLyw4 eFzMHGY0U8dg8EMFxKnjozg0GX29Kf8d9Yv66s5Y= Received: by mx.zohomail.com with SMTPS id 1736444346808142.8966002616171; Thu, 9 Jan 2025 09:39:06 -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 04/16] selftests/mm: Fix type mismatch warnings Date: Thu, 9 Jan 2025 22:38:30 +0500 Message-Id: <20250109173842.1142376-5-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-Stat-Signature: uxte1p7kqsje4iyjkawnw817fd559bk4 X-Rspamd-Queue-Id: 31E9F100010 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1736444363-510524 X-HE-Meta: U2FsdGVkX1+RADAAPRI8WaJ1iw4wbMCvjPhI8JJICcHRT3f3kGABBBNl7EPQJODOpmlxaJiQgCmRr0TmPxxsHfAkPsGs8duw14dqfgrwvQml1eo5bukldRuDfRgBzvtTPYAF0wUnN95u0f8tshjcHfQcw4Mt/1jardJiGvSnuulnpK1I//I9o2+j0h7l3/cKca41AbmveDFYd1FnEqlgPu+0I96bMUxpPg1BTW5kt1q8S4I2+oPCmdsY6TprjYDAoL63a6vbXasKnJRyIX/g+6f8QFQux9Dr+1zRweWBci1Ozk9wQ/9oxRqLzXxWNw/2jesqf0geMaEqOvObuwpV+D0AZUKoA1tMRv2pextSRolUiMeCeaG9onwG5xqCNHIiltPy5cROPpbaXVZDjAs1HI36y44W1pLt23iGK70XJ1yaJDxbYcQnBLVYonrONUSgYJ0PPXk25+zqc5CipFceCgW9GyMn877qJyPJmpuOJgezdQVZVKrLAijuLCQ+D6BG7EIVrqZ+xm7gMQaS1HfCVXZwpCGchCl5kU9eEnvjMQVzBHhEj8/JVDcACZgmxSSpo6iq0a2pu+ltXFoZUcsHR3Z3nk9eHR10DnS4jRtYlWsxq49OD1g2tDzu0LTp91WkHHyGYq4pXe+eVp+iRLeF/Kmx1BPFcVzRqSQ44YkBruOVaQRULAQKRsr9WJ77Krxy7B3cCfsh/Rg1Gk9e1Feu3lCl+XBuiCFEJfhyYcdsgg4AmHO1YomRa32uhK8mCeEBD8U29pNhYBC7PVTPsK02F3ASRbcyDCmZRrvKTVxWFRfJIVpjyCE9AA8APOhX6LHoWILGNMneFbOOd+0IBG4TiBH5Il5XauXKXQUCTO+b4Sdwav6aGqjQiLh3o+WEFpERUASWFCYvys9HcNK0DGAmTM/394I6/ED2QDpCBkZvkG8K9w770TWZZEuB6deTiWcOEpqz8bkjtfkiJedqm5g MgXxpvct Uytmzi+7rqz+ekaynJzv5SAI/xTHiPeXNm95e1yej+R24RUIK0CifXhe3gQjGVRkTpItDx0TcXicddpNMnjMvQ5wQ0M7hB0i0GOwePdOb5sv3yP7rKgnRkLNuRdaIWgTYhcxCT89n6W2lO22j7UQ+gj4rlXCiZ0AerVHr6BxLVDwU80IA4C9I1WmZp0SswV66Yx1OjWTnYxhZ5RCzPKIo4IDIypxHH4Lhv+A31APOPtqPWL9j/NLh9rmlxKFRHuQSvjOlD4dw3Rgrv3ykuI5hEg3CNhSpP/a61+Lr4+XbaV+UMstZPnZcYk/S5UQPod2bIF1U 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 type mismatch warnings in different tests. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/compaction_test.c | 2 +- tools/testing/selftests/mm/gup_longterm.c | 3 ++- tools/testing/selftests/mm/hugetlb_dio.c | 2 +- tools/testing/selftests/mm/hugetlb_fault_after_madv.c | 2 +- tools/testing/selftests/mm/hugetlb_madv_vs_map.c | 2 +- tools/testing/selftests/mm/ksm_functional_tests.c | 6 +++--- tools/testing/selftests/mm/mlock-random-test.c | 4 ++-- tools/testing/selftests/mm/pkey_sighandler_tests.c | 2 +- tools/testing/selftests/mm/soft-dirty.c | 2 +- 9 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c index 8d23b698ce9db..f6f32a5732e9e 100644 --- a/tools/testing/selftests/mm/compaction_test.c +++ b/tools/testing/selftests/mm/compaction_test.c @@ -134,7 +134,7 @@ int check_compaction(unsigned long mem_free, unsigned long hugepage_size, lseek(fd, 0, SEEK_SET); if (write(fd, init_nr_hugepages, strlen(init_nr_hugepages)) - != strlen(init_nr_hugepages)) { + != (signed long int)strlen(init_nr_hugepages)) { ksft_print_msg("Failed to write value to /proc/sys/vm/nr_hugepages: %s\n", strerror(errno)); goto close_fd; diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/selftests/mm/gup_longterm.c index 03a31dcb57577..7f1b4ad7fcaec 100644 --- a/tools/testing/selftests/mm/gup_longterm.c +++ b/tools/testing/selftests/mm/gup_longterm.c @@ -446,7 +446,8 @@ static int tests_per_test_case(void) int main(void) { - int i, err; + unsigned int i; + int err; pagesize = getpagesize(); nr_hugetlbsizes = detect_hugetlb_page_sizes(hugetlbsizes, diff --git a/tools/testing/selftests/mm/hugetlb_dio.c b/tools/testing/selftests/mm/hugetlb_dio.c index db63abe5ee5e8..62f368d4c8c16 100644 --- a/tools/testing/selftests/mm/hugetlb_dio.c +++ b/tools/testing/selftests/mm/hugetlb_dio.c @@ -63,7 +63,7 @@ void run_dio_using_hugetlb(unsigned int start_off, unsigned int end_off) memset(buffer, 'A', writesize); /* Write the buffer to the file */ - if (write(fd, buffer, writesize) != (writesize)) { + if (write(fd, buffer, writesize) != (signed int)writesize) { munmap(orig_buffer, h_pagesize); close(fd); ksft_exit_fail_perror("Error writing to file\n"); diff --git a/tools/testing/selftests/mm/hugetlb_fault_after_madv.c b/tools/testing/selftests/mm/hugetlb_fault_after_madv.c index e62f4e1388f26..2b5acb13ee0be 100644 --- a/tools/testing/selftests/mm/hugetlb_fault_after_madv.c +++ b/tools/testing/selftests/mm/hugetlb_fault_after_madv.c @@ -88,7 +88,7 @@ int main(void) MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0); - if ((unsigned long)huge_ptr == -1) + if (huge_ptr == MAP_FAILED) ksft_exit_skip("Failed to allocated huge page\n"); pthread_create(&thread1, NULL, madv, NULL); diff --git a/tools/testing/selftests/mm/hugetlb_madv_vs_map.c b/tools/testing/selftests/mm/hugetlb_madv_vs_map.c index 6c326cf3dcf6b..eda38b63e9e8d 100644 --- a/tools/testing/selftests/mm/hugetlb_madv_vs_map.c +++ b/tools/testing/selftests/mm/hugetlb_madv_vs_map.c @@ -100,7 +100,7 @@ int main(void) MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0); - if ((unsigned long)huge_ptr == -1) { + if (huge_ptr == MAP_FAILED) { ksft_test_result_fail("Failed to allocate huge page\n"); return KSFT_FAIL; } diff --git a/tools/testing/selftests/mm/ksm_functional_tests.c b/tools/testing/selftests/mm/ksm_functional_tests.c index 66b4e111b5a27..4f96126e4e1f9 100644 --- a/tools/testing/selftests/mm/ksm_functional_tests.c +++ b/tools/testing/selftests/mm/ksm_functional_tests.c @@ -306,7 +306,7 @@ static void test_unmerge_zero_pages(void) /* Check if ksm_zero_pages is updated correctly after KSM merging */ pages_expected = size / pagesize; - if (pages_expected != get_my_ksm_zero_pages()) { + if ((signed long)pages_expected != get_my_ksm_zero_pages()) { ksft_test_result_fail("'ksm_zero_pages' updated after merging\n"); goto unmap; } @@ -319,7 +319,7 @@ static void test_unmerge_zero_pages(void) /* Check if ksm_zero_pages is updated correctly after unmerging */ pages_expected /= 2; - if (pages_expected != get_my_ksm_zero_pages()) { + if ((signed long)pages_expected != get_my_ksm_zero_pages()) { ksft_test_result_fail("'ksm_zero_pages' updated after unmerging\n"); goto unmap; } @@ -625,7 +625,7 @@ static void test_prot_none(void) { const unsigned int size = 2 * MiB; char *map; - int i; + unsigned int i; ksft_print_msg("[RUN] %s\n", __func__); diff --git a/tools/testing/selftests/mm/mlock-random-test.c b/tools/testing/selftests/mm/mlock-random-test.c index 0d95d630d0450..f410699458f2a 100644 --- a/tools/testing/selftests/mm/mlock-random-test.c +++ b/tools/testing/selftests/mm/mlock-random-test.c @@ -138,7 +138,7 @@ static void test_mlock_within_limit(char *p, int alloc_size) int page_size = 0; getrlimit(RLIMIT_MEMLOCK, &cur); - if (cur.rlim_cur < alloc_size) + if (cur.rlim_cur < (unsigned int)alloc_size) ksft_exit_fail_msg("alloc_size[%d] < %u rlimit,lead to mlock failure\n", alloc_size, (unsigned int)cur.rlim_cur); @@ -204,7 +204,7 @@ static void test_mlock_outof_limit(char *p, int alloc_size) struct rlimit cur; getrlimit(RLIMIT_MEMLOCK, &cur); - if (cur.rlim_cur >= alloc_size) + if (cur.rlim_cur >= (unsigned int)alloc_size) ksft_exit_fail_msg("alloc_size[%d] >%u rlimit, violates test condition\n", alloc_size, (unsigned int)cur.rlim_cur); diff --git a/tools/testing/selftests/mm/pkey_sighandler_tests.c b/tools/testing/selftests/mm/pkey_sighandler_tests.c index cd46528d6c215..89c0f4e090374 100644 --- a/tools/testing/selftests/mm/pkey_sighandler_tests.c +++ b/tools/testing/selftests/mm/pkey_sighandler_tests.c @@ -535,7 +535,7 @@ static void (*pkey_tests[])(void) = { int main(void) { - int i; + unsigned int i; ksft_print_header(); ksft_set_plan(ARRAY_SIZE(pkey_tests)); diff --git a/tools/testing/selftests/mm/soft-dirty.c b/tools/testing/selftests/mm/soft-dirty.c index b6eb5c4642ce5..68edb2475ccd4 100644 --- a/tools/testing/selftests/mm/soft-dirty.c +++ b/tools/testing/selftests/mm/soft-dirty.c @@ -77,7 +77,7 @@ static void test_vma_reuse(int pagemap_fd, int pagesize) static void test_hugepage(int pagemap_fd) { char *map; - int i, ret; + unsigned int i, ret; size_t hpage_len = read_pmd_pagesize(); if (!hpage_len) 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; From patchwork Thu Jan 9 17:38:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933055 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 AAFA2E77199 for ; Thu, 9 Jan 2025 17:39:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BFDB6B009D; Thu, 9 Jan 2025 12:39:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36F3B6B009E; Thu, 9 Jan 2025 12:39:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 20EE76B009F; Thu, 9 Jan 2025 12:39:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 005F46B009D for ; Thu, 9 Jan 2025 12:39:43 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B183FAEBBA for ; Thu, 9 Jan 2025 17:39:43 +0000 (UTC) X-FDA: 82988625846.06.C923E72 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf02.hostedemail.com (Postfix) with ESMTP id CCE7A8000A for ; Thu, 9 Jan 2025 17:39:41 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=A35ZxRJp; spf=pass (imf02.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736444382; 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:in-reply-to:references:references:dkim-signature; bh=uB7d7cJEDiC0mfsDNRFgeWBfbQ3rX6PW8t4akxqZYn4=; b=thzLcZj2PYqPzlu7QA2BDvc+poP5BqkKfdqmYN5E7WOsyIEysHK6GTKNoYJ6sZl6Y/sbnX 1lBGlHCeIQwDL8nL56kyORCXhS+jg5T8+T1CeIyYHAC4ddBvqj+XBwG93FSl5tLTg10f6T 5rttN+V/PuBiH336uTgapLxGF6eCLMA= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=A35ZxRJp; spf=pass (imf02.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444382; a=rsa-sha256; cv=pass; b=VcEB0Eb7CXskDWaNxepeDqNsMwxBtLWYdz6hpjSVUbUeogLdmkDZnLLsMEZ++S4Kmjmpgo LEXDM4jD0k1LZpTDfHAXTzGYhun/+DYQmOk5AY9GXo+kZ0u90UUG2OBcbaTpHKHZI4u1P7 +Nsr2PZzV+7TaLFrm9iMPeMyHzQCVEc= ARC-Seal: i=1; a=rsa-sha256; t=1736444359; cv=none; d=zohomail.com; s=zohoarc; b=V6WhZ1235fCUlH1yWZPtPmxICpHAgv0DtL9N4Ez7GYG6urRZm4P28QEEcjtPEYWzuEcsam2faHAUPU4g+LOFxwxeYxJUzlyXcAg9WTRAkRET6MVprE9zdWDOzO7a+VurEWDt4UpPT6TBq+/wrDArsE06fCDPgYot9Z+Uehf4vQQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444359; h=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=uB7d7cJEDiC0mfsDNRFgeWBfbQ3rX6PW8t4akxqZYn4=; b=E70OIudC6kPSaCUlYutnjGL8ZEm7oesyAoO6JNDdSACc5o5edMZ3R/Hbf9MFfX/d/mT2QEyR5nbEurCqggF/Ol+jQpSfOrJUc9vUMR2tHJwplL3fX4gVthuKcivXhI86JLR7abPL66SYqeaBx3zdrySpY9NiCkRO3KoWVSWrU4A= 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=1736444359; 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-Transfer-Encoding:Reply-To; bh=uB7d7cJEDiC0mfsDNRFgeWBfbQ3rX6PW8t4akxqZYn4=; b=A35ZxRJpXC6uwKe+6hO0cF93zmH6F9UdJSZOA1d+7FC3QYhIUdIqDJdqBltvMeNV zlIGgSewv1HMOBh028S/kxWO71x51jpEOaAqdtQcyEt917zjUS4wZXwDzZo/5VlwkWe h6hgs+dJoPT1oEAxrw8Bz/9vZX/jLh6gUogubzeA= Received: by mx.zohomail.com with SMTPS id 1736444357047582.4071763448949; Thu, 9 Jan 2025 09:39:17 -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 06/16] selftests/mm: cow: remove unused variables and fix type mismatch errors Date: Thu, 9 Jan 2025 22:38:32 +0500 Message-Id: <20250109173842.1142376-7-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-Server: rspam05 X-Stat-Signature: p3efaaigqccndx81g99kap1nuk8dnct3 X-Rspamd-Queue-Id: CCE7A8000A X-Rspam-User: X-HE-Tag: 1736444381-32774 X-HE-Meta: U2FsdGVkX1/lKcIYlkT4wP3m46d5vj14qj2aBMi+IOChCp2sts8EMkz63ugPUmahWjMoTWmjTKXG2VLUUfa153I93GUGBKDPuiNug98i+ohpdu3sXlB8BGXQSu7LSDLopc+XL682EBxKd5awL5Q1eQHx8dYPjjIHkEDHTm4JtoBa6lrhbxv7P0hRMZVE5Fn7AgZSW1NdRXNHey48WIbSko5cAOy7aOTpICDj4AYPCQrW481myDVv1SYRNCSEjHy8liace1s7qbgWF+jfiKgwVFXnAx6Jw5u0jm1KdS3zsK04Ugbpyqj/ZX6VFJyvS0sYdLPymi9Ixl0tuc8G0WrVwhzlkZ7UUQgHXlEEzrLsNDBZ7SYwHQ0cgAqlt67neIsLyvC8SKCZovHyIb+ufvARCCckMitqn5Sey7gj6YVAkDrcp2uox9u+t4CRxJfza4BFHa39St85HLE0nHe6MZJS3EI92T5UwscYXtsW9eoL/CV5e9aMH9epyUtnrmWk9J8nuvo4Ez2bbhM9cY6ofK2WWlzgjDQxfV0r2i24RR9YaUBwtS1smUFDeZjzn4VxOYMG9PC3V77jN064Fy+xraHsRDhnySfj30j7lo4+/IdJaQ7iUWUytNQycx2dpYLPDJ5tuWzNoKNZncZ8Hm7u+dkRitx+9MFTVYMQ7IArhsEjHEDf0JPmdp59ISw7LtDWc5MO2ync5sBanH4oOs6NQofLL7gOACx6YqRZe5WM3HqIoxnwX84Q4Mu1g6pFatHHSA5Su9X63J9REYD/61814jgTaO4ZM8CrWHIUucvILMyQ1h5pdtQ0x4EkJ7JVBHXkoUM++F8ZYLwOsrxU4ezsapYFNZghXqvdhyYvEghdnGwOWHS4pxB/bJVONpqDPbcQ1nNxeHmSdGq8DeFJKuuw+1nKBpBRkc4Ejy8yz0tteGfWNp1qAerQ0xp9nrrr3CeNBNCxvZT7WwJ/MbJuaniu3Zv 66VHXX4S ib75xF5Aw81v1myEFwNUADMWXFfMPhIpoUuaC2VACg1obLFZ3JHvHiJcLqhAVTt8tFPKxFi9cKRY/P80fRNuk0N+7NBTe6Q9X4ZYnx6A/fSuh3PIyfpazLM8K0UYTyEwx9s2rWeb6HXnklZlIOvX2G2zQb0g5qmY2Itv9blQXb4QJyQnN7Do9qVPCr3qugQb92wyPspTwsOXhxo5St51jmaZds/TAJuEA7juDHZD+XMwdLAyQ+WKP17MDmPurAVW2st1sfmBhNSIQbSAQzx1/rDPJhXD0tnBLNjma9sFo826BERQUH86Qk7f8TimLuw6VQzIT 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 following warnings: - Remove unused variables - Use __attribute__(unused) with unused variables which aren't being used and cannot be removed because of function pointer declaration - Fix type mismatches Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/cow.c | 46 +++++++++++++++++++------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c index ea00c85c76caa..e37eb863e66cd 100644 --- a/tools/testing/selftests/mm/cow.c +++ b/tools/testing/selftests/mm/cow.c @@ -84,7 +84,7 @@ static void detect_huge_zeropage(void) return; ret = pread(fd, buf, sizeof(buf), 0); - if (ret > 0 && ret < sizeof(buf)) { + if (ret > 0 && (unsigned int)ret < sizeof(buf)) { buf[ret] = 0; enabled = strtoul(buf, NULL, 10); @@ -263,12 +263,14 @@ static void do_test_cow_in_parent(char *mem, size_t size, bool do_mprotect, close_comm_pipes(&comm_pipes); } -static void test_cow_in_parent(char *mem, size_t size, bool is_hugetlb) +static void test_cow_in_parent(char *mem, size_t size, + bool __attribute__((unused)) is_hugetlb) { do_test_cow_in_parent(mem, size, false, child_memcmp_fn, false); } -static void test_cow_in_parent_mprotect(char *mem, size_t size, bool is_hugetlb) +static void test_cow_in_parent_mprotect(char *mem, size_t size, + bool __attribute__((unused)) is_hugetlb) { do_test_cow_in_parent(mem, size, true, child_memcmp_fn, false); } @@ -408,10 +410,11 @@ static void do_test_iouring(char *mem, size_t size, bool use_fork) struct io_uring_cqe *cqe; struct io_uring_sqe *sqe; struct io_uring ring; - ssize_t cur, total; struct iovec iov; char *buf, *tmp; + size_t total; int ret, fd; + ssize_t cur; FILE *file; ret = setup_comm_pipes(&comm_pipes); @@ -515,7 +518,7 @@ static void do_test_iouring(char *mem, size_t size, bool use_fork) goto quit_child; } - if (cqe->res != size) { + if ((unsigned int) cqe->res != size) { ksft_test_result_fail("write_fixed failed\n"); goto quit_child; } @@ -529,7 +532,7 @@ static void do_test_iouring(char *mem, size_t size, bool use_fork) ksft_test_result_fail("pread() failed\n"); goto quit_child; } - total += cur; + total += (size_t)cur; } /* Finally, check if we read what we expected. */ @@ -553,12 +556,14 @@ static void do_test_iouring(char *mem, size_t size, bool use_fork) close_comm_pipes(&comm_pipes); } -static void test_iouring_ro(char *mem, size_t size, bool is_hugetlb) +static void test_iouring_ro(char *mem, size_t size, + bool __attribute__((unused)) is_hugetlb) { do_test_iouring(mem, size, false); } -static void test_iouring_fork(char *mem, size_t size, bool is_hugetlb) +static void test_iouring_fork(char *mem, size_t size, + bool __attribute__((unused)) is_hugetlb) { do_test_iouring(mem, size, true); } @@ -702,36 +707,38 @@ static void do_test_ro_pin(char *mem, size_t size, enum ro_pin_test test, free(tmp); } -static void test_ro_pin_on_shared(char *mem, size_t size, bool is_hugetlb) +static void test_ro_pin_on_shared(char *mem, size_t size, + bool __attribute__((unused)) is_hugetlb) { do_test_ro_pin(mem, size, RO_PIN_TEST_SHARED, false); } -static void test_ro_fast_pin_on_shared(char *mem, size_t size, bool is_hugetlb) +static void test_ro_fast_pin_on_shared(char *mem, size_t size, + bool __attribute__((unused)) is_hugetlb) { do_test_ro_pin(mem, size, RO_PIN_TEST_SHARED, true); } static void test_ro_pin_on_ro_previously_shared(char *mem, size_t size, - bool is_hugetlb) + bool __attribute__((unused)) is_hugetlb) { do_test_ro_pin(mem, size, RO_PIN_TEST_PREVIOUSLY_SHARED, false); } static void test_ro_fast_pin_on_ro_previously_shared(char *mem, size_t size, - bool is_hugetlb) + bool __attribute__((unused)) is_hugetlb) { do_test_ro_pin(mem, size, RO_PIN_TEST_PREVIOUSLY_SHARED, true); } static void test_ro_pin_on_ro_exclusive(char *mem, size_t size, - bool is_hugetlb) + bool __attribute__((unused)) is_hugetlb) { do_test_ro_pin(mem, size, RO_PIN_TEST_RO_EXCLUSIVE, false); } static void test_ro_fast_pin_on_ro_exclusive(char *mem, size_t size, - bool is_hugetlb) + bool __attribute__((unused)) is_hugetlb) { do_test_ro_pin(mem, size, RO_PIN_TEST_RO_EXCLUSIVE, true); } @@ -1192,7 +1199,7 @@ static void run_anon_test_case(struct test_case const *test_case) static void run_anon_test_cases(void) { - int i; + unsigned int i; ksft_print_msg("[INFO] Anonymous memory tests in private mappings\n"); @@ -1420,7 +1427,7 @@ static const struct test_case anon_thp_test_cases[] = { static void run_anon_thp_test_cases(void) { - int i; + unsigned int i; if (!pmdsize) return; @@ -1457,13 +1464,14 @@ static void test_cow(char *mem, const char *smem, size_t size) "Other mapping not modified\n"); free(old); } +//typedef void (*non_anon_test_fn)(char *mem, const char *smem, size_t size); -static void test_ro_pin(char *mem, const char *smem, size_t size) +static void test_ro_pin(char *mem, const char __attribute__((unused)) *smem, size_t size) { do_test_ro_pin(mem, size, RO_PIN_TEST, false); } -static void test_ro_fast_pin(char *mem, const char *smem, size_t size) +static void test_ro_fast_pin(char *mem, const char __attribute__((unused)) *smem, size_t size) { do_test_ro_pin(mem, size, RO_PIN_TEST, true); } @@ -1752,7 +1760,7 @@ static void run_non_anon_test_case(struct non_anon_test_case const *test_case) static void run_non_anon_test_cases(void) { - int i; + unsigned int i; ksft_print_msg("[RUN] Non-anonymous memory tests in private mappings\n"); From patchwork Thu Jan 9 17:38:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933054 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 5C391E77199 for ; Thu, 9 Jan 2025 17:39:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE10E6B009B; Thu, 9 Jan 2025 12:39:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E917A6B009C; Thu, 9 Jan 2025 12:39:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D592F6B009D; Thu, 9 Jan 2025 12:39:39 -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 B5DB56B009B for ; Thu, 9 Jan 2025 12:39:39 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7288D160345 for ; Thu, 9 Jan 2025 17:39:39 +0000 (UTC) X-FDA: 82988625678.02.641E6CA Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf29.hostedemail.com (Postfix) with ESMTP id 9888A120010 for ; Thu, 9 Jan 2025 17:39:37 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b="XU/sASa1"; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf29.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; 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=1736444377; 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:in-reply-to:references:references:dkim-signature; bh=Ns4Cnzb7SpJKJg+vEktGwwn4CtMu0+tM6En/nkl/o18=; b=YAji59CWH+Nt1/Osiq0ONwLQ8cQ6NuCWGZ7WpW4vyfEIU3dKyTKRGCpp15eOiE6RNg30CE cZg+Tp0nFM/ltJRxkJdQ0RhaMWSxHZo7Zql+cXichFBqjsWfZ0zc8jQT804enjW0lQlPnU o/ghUdHD3uASeO2L4j+uE6RjUwnGY6s= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444377; a=rsa-sha256; cv=pass; b=5jdGt1CLOv10dda4eAS3HZ/ZVVJzlm3L0G78uOQf9y7FW+zbXmh3WtGjfbABWRv/VfsrtI OA9TJrfGRhHbfwD22bN6V4v3uPY9PFj1de3WfkR2Kuh/Lqg7E5/8NkTGu/GtJNy45uu3TX M1PNGn6JNmqHwVDu9Qw4tiGUYvBTZRw= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b="XU/sASa1"; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf29.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com ARC-Seal: i=1; a=rsa-sha256; t=1736444363; cv=none; d=zohomail.com; s=zohoarc; b=GcRTWK8stBDDIx3AFdOF3FC0tL59k7NOZ/YfNMyaUnC+X4d5U0tq7M11m6RxtYTSPrhSv542fV1l+RATOAgW1YdlM66s1wlEzlNPeU9ilQxHhLv8Cj9GauCHVHPfV+1gXfj5ua8uGYEShRs+cv3YJ/BeEFvZz0PWCjrgfn10GsU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444363; h=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=Ns4Cnzb7SpJKJg+vEktGwwn4CtMu0+tM6En/nkl/o18=; b=HIeETnI+JRyrYG3axVdu04XWKOIIOVK6EAJoXYy+aIiXkvmFm/A8XaFv8u8IKdtCxF+rk0Ws3xmtVPgb7KKLhbuEPfPJxnMLmvXgRN4DWK7BT+Y5zZjc16SX2y+5TfjWJKwRU4icIt0Dir/igpoTRw1rbzenAy39/mDTqdSB+S4= 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=1736444363; 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-Transfer-Encoding:Reply-To; bh=Ns4Cnzb7SpJKJg+vEktGwwn4CtMu0+tM6En/nkl/o18=; b=XU/sASa1xATVXTeeB8hh/d7+0vZQ5lAGzXWOEWzpKhC4sNIoFpqSo+akp9eu1Cwq A7BHMKJO//06Zd5vbwFFfrPlnC5e7lFSns9uYNJdfyBxtJMwIBerXgc+Idcb1cTvHF2 wWX9wuwy9o+xj0v/fCN5PPabFf/TJQxsxBFr1jTI= Received: by mx.zohomail.com with SMTPS id 1736444362474197.40330045642895; Thu, 9 Jan 2025 09:39:22 -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 07/16] selftests/mm: hmm-tests: Remove always false expressions Date: Thu, 9 Jan 2025 22:38:33 +0500 Message-Id: <20250109173842.1142376-8-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: 9888A120010 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: e3kng171det9anyqezcuc45fwb1xfqrf X-HE-Tag: 1736444377-594363 X-HE-Meta: U2FsdGVkX18hCGXP6xtcJj8G4jNXsfjOzdZWqpitT0siKkl1m1nOYBkQChvu0kCSNDBK+r2c6184Y+bwEqUUJzmijKXJehb0b1J+rudBvLV+GmTdHII0k8LKH8IbR29h9uO0hcQeLeLzn/SNOZPSJh7Cw9rol4fYu6wa9yfK89CY85W1CvgvSMBwytSSaOCfNb2J5imCo9LDrXgZ7pjKuGBMhYRwJ0LJxVcF2TTOnopLZOtheghNr+oUNpC5PMx7zM5u9U+9UZGkoAPvE/W0Y0IUn6kTRpA+8K0NeCGsddor7X/9rZ9c8H1V51Nah45Y/rY8arMb0QNo3W0W9Z/Sf05lHNYi7EsSi5i1VrS3KmVz2pPmgDgfGNXJj3McAWFYqv9t0yT8sBdxQER7qQQJ/aRu1KOyZSlHWeUTF2H9WuyThxRbtP0R6WxJsdv/d7CJT0986GjSi2sw2fkRzx7hDI1fonjvCsjnVemVwppvEfGMmTufB5cgv/nmPD7CepfJ465qFARVxUbchdNkjgXUglNS8FpjS2nu9me1xZlQ1HNgSlmGxb0awr5AIkfmy9J2I1KZ1WftBZjRrYzaXuqjD66wozzih9z6BNC6LgEvYajiMbBSwUpMUU5Hwxg0jpqJbsBCxCzyiX+QjU6dIT3YfPGfancxloVtKDOL3oN9qqIC1+2fe8/L5C6egXldzS3ku+pRF3sNPY2Kn94R92VPFiDEYTCAiWtwXmxKa+65gtl+sxN6dM5xVIViKbZa4IOkUbA6MXQAmTMNxpvc21I+dZr42hzZVCUZMHNYrzOPsUa4g0KTsMfft0zgaP63j1kRd0bo5eyYQ+LD1CuSggDhZY2cwbl6acg6SNZTMqMP9ZHTphtDOu0JYVfFvqOtdy5EEwKcvtX6v3SCkl587dkvmUF8hdspVA11ufGAHCz5aAAbKs0E2twwWjQMYnXtdDwQCSt7CtQaSQxJQaGOx/k VWlYTfF7 PVF+UWCmpLsbLTxCP+dQJxO51dfev+Ux4nK+yUAgNZz2g28A7IZmBjZVrk/uJB5ElpaA/US092K8i1jRyRlvTB7HQfBpGNZHCT0JLaeHWw65v6iamWqleiDjZzXrq3M+kzed6+JBqY8sNA3sMm+VKLc0Ta1rnmNUnpcueDVkSx2xVN2Bp684pR6l7PIdUCIxY4qT/D3PGWAJtOC+NXYlWiUFMiniSFxsb5G3qrFOAuiABe0tyWOiAEOINuXOYIUOaho5t83RkOnvs1DL+fFDSg9mgWlFpX15wKkqYEOqDm8xtjnFKa2+XIAP5qygABxlc+SaR X-Bogosity: Ham, tests=bogofilter, spamicity=0.001886, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: As default_hsize is unsigned, it is always greater than equal to zero. Remove expression which is checking if it is less than 0. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hmm-tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/hmm-tests.c b/tools/testing/selftests/mm/hmm-tests.c index 141bf63cbe05e..3b4db583bd3b6 100644 --- a/tools/testing/selftests/mm/hmm-tests.c +++ b/tools/testing/selftests/mm/hmm-tests.c @@ -796,7 +796,7 @@ TEST_F(hmm, anon_write_hugetlbfs) int ret; default_hsize = file_read_ulong("/proc/meminfo", "Hugepagesize:"); - if (default_hsize < 0 || default_hsize*1024 < default_hsize) + if (default_hsize*1024 < default_hsize) SKIP(return, "Huge page size could not be determined"); default_hsize = default_hsize*1024; /* KB to B */ @@ -1579,7 +1579,7 @@ TEST_F(hmm, compound) /* Skip test if we can't allocate a hugetlbfs page. */ default_hsize = file_read_ulong("/proc/meminfo", "Hugepagesize:"); - if (default_hsize < 0 || default_hsize*1024 < default_hsize) + if (default_hsize*1024 < default_hsize) SKIP(return, "Huge page size could not be determined"); default_hsize = default_hsize*1024; /* KB to B */ From patchwork Thu Jan 9 17:38:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933056 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 977F7E77197 for ; Thu, 9 Jan 2025 17:39:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2634B6B00A0; Thu, 9 Jan 2025 12:39:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C1916B009F; Thu, 9 Jan 2025 12:39:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03BA76B00A0; Thu, 9 Jan 2025 12:39:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C06536B009E for ; Thu, 9 Jan 2025 12:39:45 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 7DD75AE174 for ; Thu, 9 Jan 2025 17:39:45 +0000 (UTC) X-FDA: 82988625930.25.831561A Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf10.hostedemail.com (Postfix) with ESMTP id 9E8A5C0003 for ; Thu, 9 Jan 2025 17:39:43 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=GEjQc+1q; spf=pass (imf10.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=1736444383; 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:in-reply-to:references:references:dkim-signature; bh=whETehW2IwIxAg6V15GnWifjsiCvW0cZ8n4HvvwTvLg=; b=vrFCH+CZbkm/mTnbhvYkFoNfpM1K30BuLiqCK6+GqNqtB9mbtzGkYvU5IAiLuDaGXBQLkl PNyNztQNqHku9fNPVCklAQYcmVaHMCuNFnPg02Ym0Qdu6QNucvNKBLOEeT8wT1M0vPf/0h knAFfaVWMFxUGgYWZnTD99WNnWLA+Ok= ARC-Authentication-Results: i=2; imf10.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=GEjQc+1q; spf=pass (imf10.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=1736444383; a=rsa-sha256; cv=pass; b=WtNsVKgunh37SfnFQw2HIQgTpD8iIEGsVOt3ZCj9K+9vIBiKwTiAyRSkFhwzW7coMhyJlP 23uLuWPHpmdtBH3y9bPt1/t0MXC0gnpkcZLc+vpN/rjs/g6vI6pxX9Z8O1a4fn5d4fadGU rWCbC649jYHEuLWULdn9TlxLW9fwQKU= ARC-Seal: i=1; a=rsa-sha256; t=1736444369; cv=none; d=zohomail.com; s=zohoarc; b=dQCywtZBGitfnS1qwwMPwcZKKj1fcOvWgFyAjsdIOUuQ9DOn70A4XExTpbEyKFV0pZAi1azdlHzgshbb8nqRu0//uMK6R9lUuwGaBC2v1r0SyFsJ6o3ViD8PRcQWHmnQ3cZIxGf2ItfsRUAIuUBMHiYFj/NGE83JaFszncqB/oo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444369; h=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=whETehW2IwIxAg6V15GnWifjsiCvW0cZ8n4HvvwTvLg=; b=MNomiooTbKPn+WmlCmE0PC/5LcShiCufrWplrB0B2zmThdwfttGHYQyEDzth6gUdpFRYT0mku71g6hpYHBh/J/zBsMsZVcd8U/m1roQ852uGKe5xKJR/rTk5NdmbEX88q4i1Dk8ZievNtgAYv1B9xk7iGtGajUpLQUmYb+0DJU8= 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=1736444369; 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-Transfer-Encoding:Reply-To; bh=whETehW2IwIxAg6V15GnWifjsiCvW0cZ8n4HvvwTvLg=; b=GEjQc+1qCZ9XenjwXGHFiWjazc7kB1auWHezfrPEIYwjDhXp5wW3Ivn+jWZ6QIk0 P30gaB6q2IBWCRR7EmiaIVhjCjeES7UA23DfDNSl3ya6lDaNIFRh3eeiYa/X5oLc+FB G3ccisZGB5g9LCi7Mo3gBxLPWq2XFAG9sEMFHsAI= Received: by mx.zohomail.com with SMTPS id 1736444367800740.2406611122897; Thu, 9 Jan 2025 09:39:27 -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 08/16] selftests/mm: guard-pages: Fix type mismatch warnings Date: Thu, 9 Jan 2025 22:38:34 +0500 Message-Id: <20250109173842.1142376-9-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: 9E8A5C0003 X-Rspamd-Server: rspam12 X-Stat-Signature: 9xnneho7aqkkshrs8inamoeeqbif46rm X-Rspam-User: X-HE-Tag: 1736444383-710953 X-HE-Meta: U2FsdGVkX1/glrW/jS73+mukzPcxTHbUG1/EKZ++rF4/6+7/24uT1Vq3fZofB/M29vst5U8KlmB+lfwypv+nHjJnieogN4jJx2h+D6IT4JKMq9KIDlHllSFoNs7lTLl9DdNP55aIR/gPP2Q2K3HOa0dMjWDuW0JDBlgWK3wdWW946MgH5XzmNgHU0/Z1rfUUlrDZQRmrHkWvq2EwaGIz+JliI7jb8GMllrcDAYTHnHz11FM9JhvzCx6b9Zk341Rhj24m16GJLubfCtj99WGbu8VU4asZj53a2HsRijLZqa+jDveTokuDEmfTshVXIboOIoaq5C4OBjCp1dpjXXmTjLzT3ONHQZPQ5nqJth3RId8MZzG/i31/i5yPgl7rz+s/qKKJzeVw9dcyDS9U7J6dUQ7qxMeS4PA1AzaUHn2uNKKRBBl7gCJD1CWVuE4iXHkAVM1Qqh396IkeQ5G1nsbDx0lp+RyiXA0UPi3Ul9yDbxb/qbUyy2A4AY3hfOzr1D/hxFFKTegRri35eqXgoOrwlwc5EeMYTGnef79Rz8eVRGQ8Hf00Ubik1EWqwPzDoeK01aSv1pXd6K+cQ9x6vEC4CB9/IEMzHwx/svbmbYYgujxRfju+LkjRoInlaAsKc5c/Dq7JRb03wdpap8tfgH7jfrOg76aWyirJMAY8+skConjyUkrUdPyveLdb3MPRFb+ZpWO6G7cz2IXFD//kLKvp9V2yBFOu1rqHGJSsMVRzq8Mq9sFyufPCwtE3/388esDJLysfoYOqssPHnc0eOjYpmVAJ1xL7LB7ITK+ce4Ubr5Xqz9nstY9xjXnIOet1nhwHDF8WGQoXjgoy/W+vDY/3FakWFDuY3jKMUMjjpEesbykOClcABRvBrwgvlMz423YEtyxLAP6vxdFhnPhUn5s1MRS1zFYWiRccc+Go88zBCxj0OOgojerEg4fHqdw1HMMLHlUrlHr36dMW9EpzGej 0FabNNqd EDnxVkWtJBoaqp5yb+PBrKH2+EgIlz0t9/QMAuuArZC2NzisszP5h6l9R8B9rfoo5/85dmGXheucZ6ORHr6LR9vbf8ahP7Gp+KVAD4qsM97QQu+zPIeEzYHZv1tzLiNcVvghAnSdQsJTMA9OwpBmvmgm2LMFqCyR6Yi+/OuxLqODgNAFJsSAlWq8bwq6ppFUubWjwKm6tyWzynm3IoMegt8YN/rgVvRjovg4V6JlzQwloMzlx5Sa690ilOnJZ5NN7QOBwp8VbcXC2JozGU8gb5gK3LtpbI8fCJWj23poaGV8EYiXPRMRp2fvCgDVG87jhJo+n X-Bogosity: Ham, tests=bogofilter, spamicity=0.000057, 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 type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/guard-pages.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/guard-pages.c b/tools/testing/selftests/mm/guard-pages.c index ece37212a8a2e..fc1165ef2015f 100644 --- a/tools/testing/selftests/mm/guard-pages.c +++ b/tools/testing/selftests/mm/guard-pages.c @@ -142,7 +142,7 @@ TEST_F(guard_pages, basic) const unsigned long NUM_PAGES = 10; const unsigned long page_size = self->page_size; char *ptr; - int i; + unsigned int i; ptr = mmap(NULL, NUM_PAGES * page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); @@ -1044,7 +1044,7 @@ TEST_F(guard_pages, fork_cow) const unsigned long page_size = self->page_size; char *ptr; pid_t pid; - int i; + unsigned int i; /* Map 10 pages. */ ptr = mmap(NULL, 10 * page_size, PROT_READ | PROT_WRITE, From patchwork Thu Jan 9 17:38:35 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: 13933057 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 DD811E77197 for ; Thu, 9 Jan 2025 17:39:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6CCE96B00A1; Thu, 9 Jan 2025 12:39:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 67B126B00A2; Thu, 9 Jan 2025 12:39:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F5FD6B00A3; Thu, 9 Jan 2025 12:39:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 2F7136B00A1 for ; Thu, 9 Jan 2025 12:39:51 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C92A1802A3 for ; Thu, 9 Jan 2025 17:39:50 +0000 (UTC) X-FDA: 82988626140.10.FD44B0C Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf24.hostedemail.com (Postfix) with ESMTP id E03AF18000C for ; Thu, 9 Jan 2025 17:39:48 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=SGRjUb+y; spf=pass (imf24.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=1736444389; 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=sNEn0+DKZ9Qi4hSYGXnwr6Bzx8uRu60xvq6lQUh7sU0=; b=T7Rhp9xe7bPl7HeUZNASW4KT/kFm9c4C31NM/1qVoEWZUQhhtiU0bWVO5zN6x8xbm96qiq t6LhK7Fh5mo3wRkIlCBp+TlHQOE606FLDTyvzajPeh02r4JZ4wJ4rRNJJUK3BK0HtWxwLc FJ7x327IUC+qd9Ce+HQpvbFs99Ke9Cc= ARC-Authentication-Results: i=2; imf24.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=SGRjUb+y; spf=pass (imf24.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=1736444389; a=rsa-sha256; cv=pass; b=6qM6pURA0VG1DiS68c9r28EPqahcxbG83oiXVrIpkaQNZv2LVDfyevc3pj2MTcE6mh+UoP prLEbelhE91CAdQM9ycmmuU67lY1SBVCxrBIEtm5+N0t7ALz9Xrg5jSsi4S4QilUIx6EXj oivLXzu12TlvX44MnQ2kYuHV+F187qo= ARC-Seal: i=1; a=rsa-sha256; t=1736444375; cv=none; d=zohomail.com; s=zohoarc; b=gCeZlQSBxYxbEofSHyuBmGhzyA3rtzfkyJCo4CBUSewzwXIKBHHWuNlBNtKEo4hcWWDL3aPPdBgjfswYXrGh+Vpg0ilyRmaFA14cICnowljxLE8VS3Xvh8oxvy/QDov97Y6x90/xvXt35VAzugCa7rxPMC3k0NuaZUByza+nfY0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444375; 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=sNEn0+DKZ9Qi4hSYGXnwr6Bzx8uRu60xvq6lQUh7sU0=; b=kCBh6gBGSAHSrbZ2Ruf6BNKiskGvBVcUyLkauabrNsRRKFwwLnnKbzV7zQQvmEWPxsKaATTLOjG41kyoy7g/ZhoC3lW2U/UCyuj4tS15jDCajgVcJ0Vfnx5Ci/Cn0LpxpooFTkcDKQBOcWcUEOiT2jPPSIrbMA6uCfOrHmxQpJs= 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=1736444375; 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=sNEn0+DKZ9Qi4hSYGXnwr6Bzx8uRu60xvq6lQUh7sU0=; b=SGRjUb+yhYnaImCJ1G16kHv9uZN4IhywMM8RR0XaD6Q4mcm8Vga2Wm0qA+M86o+d R7+jHZaD7zK1kj/bMiOnNONnDcV6c5RSpT4N+gJmpuM5CKMzuRytfUKiya/2Waxssm9 etc1MM2baE5Qp3O3p5mJHDj2MIxMN/fFQtCTVAtg= Received: by mx.zohomail.com with SMTPS id 1736444373227676.4020326211726; Thu, 9 Jan 2025 09:39:33 -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 09/16] selftests/mm: hugetlb-madvise: fix type mismatch issues Date: Thu, 9 Jan 2025 22:38:35 +0500 Message-Id: <20250109173842.1142376-10-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: E03AF18000C X-Stat-Signature: ed4in9e97ci7qs4iscqbmxyp4zpneqgo X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1736444388-514527 X-HE-Meta: U2FsdGVkX1/4VNvrwBFm+7NJlZ36Ue9w0LfxGmV2NijNjoU8EPZcfmP1Ve+Zj7e1SxpWmfWiuqI77bL2U8btHtaQsMRzu0M7lAVqe/i9J7y+KzqGn28oCn7b4EC3TgWGjKGQY6jg72VXVFfmBhwvJ/c3kxi/be+BDE623PaqBn6+okgQ7Mzp1mjiadoRRMUWCnbah8pDu2uXdQqPacLBpSz+eSuoMCWEs+Ty8wHaCHnB7r/LjLi1RZM7UN+75wbeJJaQNzvBYKpsvSrjqAGNZuh6/Wzjq1y90otewtaUfISvlUpiPXxAkUPS/oBa0JaChB2fRt/7yEd02X57Ezz1HmMhCgb7xvXYqEV1Hh0/KeJH9bngaMwz+b+en3giFIYf6JNuYeej8Dd2uy/LMTWnFAz0Sw34GDnfbQeO0UgTDx3fmH4Iu/dLw4c2NCs5PnqGROuHjsWfuB9kIZ2brWqdet4Hdz4hdAtY8g8irwO6jUV0L73Ja5dV9DoA6WgKdeXRHWHzWpfeslVbnRFzCk1Pp4pfsQ+kvZCKFQwD8GX3O4xzswhACwqgloUzB7cxM0ANDGqaOtdK/+DotA/1rTwCmjWpCFFvTrI9a6VtAzGR/Mzgob1TPuCHFDXAvJWohorZkXvQkEST4yNi2rnXEDA+Rl0hz3yKWMkW1X92bcHEs0rgldt8kQvaCNvTp9RKfEc4npNFaG+03vxVwzudeGjvY4GzSt0Iez3RUlsAD2ERBTwOHuFlVvmmHHMw8CPPteOO8dAjjtZT+A/MdW+qa0mqZ12pjNUG1j3TMOIyozDj33xTTn3i2JeGMwpnhuOBGIU0meBlBgHn7FdObfbEQ3IWN9Mu+t39uEZS1HfHXrsSGw7PbhbsvOwGT03m2zDFCSralgSQ9FF+6Zdg7Xf/F1m9dukqho0wFrGzHnodUIWCX+5I4yg+7crLKu4EHe3JEliP8PcWSKK8NVhZtOB8cTr 7NTVK/Ai J3NQ3crl5BB1o5dl4XeenmHy+BUz5BDVIL/o7xwViN/Tkq/SxCF4UaMSY2Q0F2XcOUGFavyD/wA0g9TyxWGlQzy7Tqp2ueWlz4FMrNaiM76I0/VaBK/4KtrgDtoSgwdSsmGUJ3PwTdManaZ6yC+C/KGuWDBMUTycowZarRC4FfM31IiR4vwsvkMNAyFy12iIkDooDpzFMlUCQuxBt5wEMXdLgJwuVGvy3XhoTS03PdXtpbj0uzCQE6PlVODDguTCwz+Jj+R7xZUiQ+9OTnzQfwUm5keGbel/mdqPjyttmtINzxtCyAVxGhkh5lxgIxTuOT7hrYfinJXWhI1penRlOePqXTCvFwYZOTsPmRPAxtM25amM= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000632, 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 type mismatch warnings: hugetlb-madvise.c:30:25: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare] 30 | if (fhp != (exp_free)) { \ | ^~ hugetlb-madvise.c:114:9: note: in expansion of macro ‘validate_free_pages’ 114 | validate_free_pages(free_hugepages - NR_HUGE_PAGES); | ^~~~~~~~~~~~~~~~~~~ Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugetlb-madvise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/hugetlb-madvise.c b/tools/testing/selftests/mm/hugetlb-madvise.c index 43f16c12c8e9a..8f527084858d0 100644 --- a/tools/testing/selftests/mm/hugetlb-madvise.c +++ b/tools/testing/selftests/mm/hugetlb-madvise.c @@ -26,7 +26,7 @@ #define validate_free_pages(exp_free) \ do { \ - int fhp = get_free_hugepages(); \ + unsigned int fhp = get_free_hugepages(); \ if (fhp != (exp_free)) { \ printf("Unexpected number of free huge " \ "pages line %d\n", __LINE__); \ From patchwork Thu Jan 9 17:38:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933058 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 35A88E77199 for ; Thu, 9 Jan 2025 17:39:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD4E96B00A3; Thu, 9 Jan 2025 12:39:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B86116B00A4; Thu, 9 Jan 2025 12:39:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A27776B00A5; Thu, 9 Jan 2025 12:39:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 74FC56B00A3 for ; Thu, 9 Jan 2025 12:39:57 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 13B5FC0333 for ; Thu, 9 Jan 2025 17:39:57 +0000 (UTC) X-FDA: 82988626434.10.8009BE8 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf08.hostedemail.com (Postfix) with ESMTP id 43ECC160021 for ; Thu, 9 Jan 2025 17:39:55 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=ECXrcFQi; spf=pass (imf08.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736444395; 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:in-reply-to:references:references:dkim-signature; bh=oZBjZaOGgfPGxEQUCi97MIL7c/M2e+noWOX5E6dbvzM=; b=n8s58qlQSYq26h/mDCS4Xe6MkpLQ5SZiQWb1gS73rTIEqjF0bStUtYx9wj55XwCw/0LIxt 5eOkPw6I2vomhpRKVWPk0ffOoMOiLMXRNYJJudTzzqj4AijGl4rWMBn6Z9ePpq3QnD2QdL J5ENcf5kBHA9B0x7ReA2yi9IryYmODI= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=ECXrcFQi; spf=pass (imf08.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444395; a=rsa-sha256; cv=pass; b=zN+tmW3iyvG6Vk5Nv4/HQtIHf0rMnztBlX9Mm20avkPaL7ds6UGOj+2dWlZAU0Jcwn0avQ A8Fgcx+EC/7MV02XOziEDUtV0VSeiTDGFozm8u4QFYC+kQvxz+D9Iksf7Ep9WOmrQP8Jhp 0G4anAhB0T5kGuXjEaZwlCDKAxWZHwg= ARC-Seal: i=1; a=rsa-sha256; t=1736444379; cv=none; d=zohomail.com; s=zohoarc; b=OCqbFvX5wfA/TmAgcrBar5XSYD1cadtxE6wTnaXMAPBMpIMVYwwCuO+1+EkABkKnNKHezDywRDydrFPPTkFZVNdIJsbbLg2QUFlAFMNn4enNeX239Mpm/ojDCRMxPjcDO+K7X4AIK8rbyIWGAywlTxGzDH6PuzYvZ6P8bQXpTtw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444379; h=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=oZBjZaOGgfPGxEQUCi97MIL7c/M2e+noWOX5E6dbvzM=; b=NuH+xeXHYQRy4+zh9AHKOa1kfFon6fejdJuRdRrE9GaEM8hPbENhdhKWMGvZZus+24elDN58igzLqfSdAm5EVMLyG/K/Z5+FVzYBmBJTjvVZ78C2IKHY1rSl2f9G+WtwSmivo6ssVhLFdXY1tRh/TOFn8czNXNvQiZyYoq8anb0= 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=1736444379; 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-Transfer-Encoding:Reply-To; bh=oZBjZaOGgfPGxEQUCi97MIL7c/M2e+noWOX5E6dbvzM=; b=ECXrcFQiBiP0/jq8OCFeJldeTj49vd3vcwTY4r3jqUoK0xOPzLuedKBJrXAjENYi 3xcgifqeiKewbARFJtM35wijNH6ioGakR26VK9Zk2b3rvaBlK6wNXRgmhKIEpqsVWYj /ZZ7MlDeq31L3jOeet+bzP7iZ8Eb6+RewjgOU5U8= Received: by mx.zohomail.com with SMTPS id 1736444378245741.8870123024191; Thu, 9 Jan 2025 09:39:38 -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 10/16] selftests/mm: hugepage-vmemmap: fix type mismatch warnings Date: Thu, 9 Jan 2025 22:38:36 +0500 Message-Id: <20250109173842.1142376-11-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-Server: rspam06 X-Rspamd-Queue-Id: 43ECC160021 X-Rspam-User: X-Stat-Signature: ce1sm74bn5nfrzk1bft5asrmdqp6cuyg X-HE-Tag: 1736444395-939661 X-HE-Meta: U2FsdGVkX19EjpScDP1j1cBMGTvMIoQZodAPEKBcroTPoi8yK8hbBeE9QlDCOWjexu34264Z2A9IdZ6AZTf+GCCEPCqyhDA7CbNozc/Nyn0rihxfuSZwXZLkFrRZCPspZNKPEAsspq7oeoUTQ/qUcxFfxZD6dcLFmCmhG7QVitZwapvamdZDutA3xmOZkKqpvNrMgItCPuEOwb61RRs6RoMTiYza4wj2/Rjw7TmtbnLzRSj6OaZFyVpQS7yzQHzOTfab45SSJ7td0xO4a8wgazxhTXWSdD3CBqQ6H/IUUZ3FjrZ+pddf8XosQIBxm2gIiIirESPTS5sCuOcKkH0M/3POXa5fRsYG6dM2tiYLM1u1g1wY0ywgleL8G5CSQADdWceQaKiJ0Bi3xZ7lut7/nBExaPVWKedAcnhcrgmEcLBm+PpPN5yj/Sqdrd1cRyvzgQnq6HORHWJZW1TyVg+cdG2CJEaBhQnowIG6Gw/074/tEPk4MJdZSPkUnGw/TPnDwfyZqPNtOCHU1qHpQawRIbtRfp2ubzYYCICk7dFuQrtzaTdZ+kNlHw/3V962axcJ921K56dm6Cow1NMCXihHKnxH+/NqbXH3QKoFUnl4mEec/syZXFpC5b0a+ANhTzsHwxxXteiUJBebyFQAMXmjAiG2+9+qIvpZTKvz6AFZuX8UDsVoc95AuP4DGT5UxWGRQlWO8hOqJHiVJfcKQnV/93B3aOvw4DNyqFBKOACdSFMzN/XdrDsc/XwZ/MFXnnAG1vaoK3SdK9A+z4WWQ6UtWpBJTCdmDB+fJlkzOkwM8SXyqa2XIbC43gNaI92Z+nL4BmeD6yzvGY2+vmHf/Id4CpZ0JT6ZIxcErbnT84VcnYDcpi5J96404psGFP5hwcZ3v9E3gJGeVymNA7iPdlMnMjUlr3Q96W2806vSCp02OcWK3HTEyk14r9gorEmTuhMmwuGfSEqcsf325/WRuYP k2c5jVly nIoGQcJwFsGjSV+OxgQWPL9bhJzCOwfJAELOBt2R4phsOBhbMaqqP4Ljc9utc3ztNH+na6VXlj2JLL4Pzen6Vct0L47kKQNTrNfOBHw0IPvsYLgESzCgCG3HuAL6fAkTCFU2uVg6cdE4kmLVAQhMkekaQWMK2feDlS1EoJeSoU6e29mMsaf9iW9vDKg/vn0HNy/QJ4pBb9oYFxulhCHI6LLeT87/YU4QQJcFA3HV6XS09Y/w2CkkEKoC33/hokhLWf6dKDy/dD0q5K1i62nqMi0+kFt6sW09AQ9+jkhEBTREEqRSv/T8nVh9WFrJDNKNYtYiI X-Bogosity: Ham, tests=bogofilter, spamicity=0.000116, 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 type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugepage-vmemmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/hugepage-vmemmap.c b/tools/testing/selftests/mm/hugepage-vmemmap.c index 23e97e552057d..8d30ebfc9b86c 100644 --- a/tools/testing/selftests/mm/hugepage-vmemmap.c +++ b/tools/testing/selftests/mm/hugepage-vmemmap.c @@ -51,7 +51,8 @@ static unsigned long virt_to_pfn(void *addr) static int check_page_flags(unsigned long pfn) { - int fd, i; + int fd; + unsigned int i; unsigned long pageflags; fd = open("/proc/kpageflags", O_RDONLY); From patchwork Thu Jan 9 17:38:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933059 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 9AEA0E77197 for ; Thu, 9 Jan 2025 17:39:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2897A6B00A6; Thu, 9 Jan 2025 12:39:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 210C96B00A5; Thu, 9 Jan 2025 12:39:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 088CD6B00A6; Thu, 9 Jan 2025 12:39:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D74F96B00A4 for ; Thu, 9 Jan 2025 12:39:58 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A62D21C68EF for ; Thu, 9 Jan 2025 17:39:58 +0000 (UTC) X-FDA: 82988626476.09.8B11879 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf14.hostedemail.com (Postfix) with ESMTP id 9B772100005 for ; Thu, 9 Jan 2025 17:39:56 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=UQ3swVZv; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf14.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444396; a=rsa-sha256; cv=pass; b=El9TQoqrHhEfOJWsC5KBCauR0eeFtzvRQbe3Iny+/JepHcj8b/4uq9SxMmtv/Iz/Y3vByG f49ixK0f2iwd5UYKrLtK/nyr2pr13fusg70lt6Irm8/bdkSwsUjTLFaoxlU78NtK5jQf+X LeR1NzopS8voZGmJyXiNjHM2TqOLGYI= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=UQ3swVZv; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf14.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736444396; 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:in-reply-to:references:references:dkim-signature; bh=cUnEN6YUpTMMgOpnHZpEAdwLBYl8OGrY4+GN/GOq3J8=; b=ki2c203QXTn4JIvTEPXAIvCAcP+6PCfD71OgJ/xQ3C6OUGBAjkHIlcoVCqsGxj/8P7TNeP K1X2NwV5+lKze1G5IImqTDSulRhrFDrKVI0pjyd3R2skG6Ms5Y3DJpu9QgZ7pZDEkifJUu eD6WCPO0tpRE4KhL4SFsudulV5bccQ4= ARC-Seal: i=1; a=rsa-sha256; t=1736444384; cv=none; d=zohomail.com; s=zohoarc; b=PHb8dCW9PsSrkgiVvy89CX6NtRRSc5wJyJpqofaA9Dm9uTekK3hmP66n8zHmSXHaLwXdnsfJrZSi1lb2CgfN/56gU4Ldb0pz7NymDHXvtk2CwX5+fv/hilL3lnzaYdgWheqFhhbo+id4bokFtW+lmDgoLVZVQkk6BmY6NqB/c58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444384; h=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=cUnEN6YUpTMMgOpnHZpEAdwLBYl8OGrY4+GN/GOq3J8=; b=U3qhjteAQzwH/C2ZCdDKiIb4CM/PFVYxhZ7tHLLsitY0XLdGkKQopA+BIb2ltOTCFS49X776Q+777LD8rw4E00V+8KsmovQpxFpm5Kk2X67IVN7sRIbG/RjYBtjoVH6/ysbjS6GFaFeu6X7NS1PUXHkYrOBqkD9OXKCAU+fJh+g= 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=1736444384; 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-Transfer-Encoding:Reply-To; bh=cUnEN6YUpTMMgOpnHZpEAdwLBYl8OGrY4+GN/GOq3J8=; b=UQ3swVZvqhbr8qX8U+H5z1BO9RPCr4yETMNjAHOUT7lN3IGgsnEudIoj+S4145Pj shouJU/NVGZtxN/HmJ7FskpjssHRat7nBX50KjAcvWfno+eXQtCwc0HS9SYWUVkvgZF j4Sg2EPiAvoUzvP7h5OGLApi6fVsywicPRqBiaRs= Received: by mx.zohomail.com with SMTPS id 1736444383262634.9970969812879; Thu, 9 Jan 2025 09:39:43 -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 11/16] selftests/mm: hugetlb-read-hwpoison: Fix type mismatch warnings Date: Thu, 9 Jan 2025 22:38:37 +0500 Message-Id: <20250109173842.1142376-12-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-Stat-Signature: gxgfcw3j5emfmuokmm1jtze7m4yyjumk X-Rspam-User: X-Rspamd-Queue-Id: 9B772100005 X-Rspamd-Server: rspam08 X-HE-Tag: 1736444396-675658 X-HE-Meta: U2FsdGVkX1+7KtzfK/FWnmsnupazf0utaciJbN2CQHRCpn7ABpkWNe2N22iBb88/k6Io+VAMZBZLolFSQ/+8djtctWPp+iaG4yHtyS92q+poOHX64VPLs5lfCQLDiNp4Yxzd+Pqg/udzwtATgSfjMjmJqF1vRpU0DqAR26hViF1hMYTxvLL0qAfNApnBapuLZD/NWqSaLvQgwCZsC6A2zIg64gWyODgppmtWM+nEhffWWaPcsxOIQi8B3zU3/6gNBbF+OiNfbj4w9ROrned/QglKG+5Q9e00kFkgQYEAWjhqDRrn0pg1tHXXpWbTX5ns+YRsK98JgUSPjbbzQ0HBw4lKdza5yJtatSoZBoMDJipqJfRg5Suq3n9CZDpQipqn9HXDqkSLh0+QUKvDNjna5BYj328PEjf/NvIOggBkRBM/DS+h/bvzViS0mARRen7SRsF7NUaIqP1WnJ5NnVOXJlgceWFrpBCJ7P7CDd6QRt+UuKWRyZxvlLgyE3GFNb+hGmHHiVke97uUeaPXJQU6pgMCtFSx6aBCx7tAgabgUUWJnA19rFmqOEBfEpi98q3R67RFcGBkdpt3Vrafayf9in8k7CMxrgb48C+pAHFnGz6xCFbH1HpgYRNI1TLofZRtn2dAv7Ev0gnwjplaRLW1FFjW1tCIVXkEN8YsVrhkSw0giK09w3BT4nJxfSFoFCuwo8K7oo0EIZlx4GrPai0a1OH5vbmNEzPasvyN4gIcIjO+CrvL1qhaP/nCM7CdLhgI/4P4WmhD5ilaffm9ZyFDlbNXus6YdYZTCrhTkVyRBICqnosbFaeCUiDW+xox0yDXVHVWUqcIdZsKgq6m/bS3Ml+cXEq5RtzBKehwbt60oQJGkh/tU35paP7EDFy1GVsAJ0NzGEFsUTvdTbzPVLEoamf5qftz5vxVy31sucVpTwwt5UpGkT9qodKJy85hAjEnZX+X/GM43Lj+Ras95+Z v+GihtJx VDN3VeNBua/YQ/s9x727vP2QWUEucdekXeBa0L70CTUmrmNTpSn2l8h6VHmmDDfXAEktKQsE/nehXaLqCn9a8qZj3+TSV9oB4A9/PkL6glU2ge7cZ3pWmB5QVMk/jvw5sxbWmwcjpPyk/Nv0RyQxFE02FJRVngon6vCN6Jveho5plM+cWbKAtlPb5+A4e99vxGkd3o4uch5vvXLKwh0T29EZxdY0/Ai7LU0f2RK667tR16gcUTrV1Fob0Zs0XXBa/pWQ+5dmiwEHwY9zzKhzfooOIuF2E+nGZSjksZa6EP8kV717h5yMvswy9x0bvS5FZf9n6 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000203, 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 type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/hugetlb-read-hwpoison.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/mm/hugetlb-read-hwpoison.c b/tools/testing/selftests/mm/hugetlb-read-hwpoison.c index ba6cc6f9cabcd..e2a2bb1989d58 100644 --- a/tools/testing/selftests/mm/hugetlb-read-hwpoison.c +++ b/tools/testing/selftests/mm/hugetlb-read-hwpoison.c @@ -72,7 +72,7 @@ static bool seek_read_hugepage_filemap(int fd, size_t len, size_t wr_chunk_size, { char buf[MAX_WRITE_READ_CHUNK_SIZE]; ssize_t ret_count = 0; - ssize_t total_ret_count = 0; + size_t total_ret_count = 0; char val = offset / wr_chunk_size + offset % wr_chunk_size; printf(PREFIX PREFIX "init val=%u with offset=0x%lx\n", val, offset); @@ -83,7 +83,7 @@ static bool seek_read_hugepage_filemap(int fd, size_t len, size_t wr_chunk_size, return false; } - while (offset + total_ret_count < len) { + while ((unsigned long)offset + total_ret_count < len) { ret_count = read(fd, buf, wr_chunk_size); if (ret_count == 0) { printf(PREFIX PREFIX "read reach end of the file\n"); @@ -109,7 +109,7 @@ static bool read_hugepage_filemap(int fd, size_t len, { char buf[MAX_WRITE_READ_CHUNK_SIZE]; ssize_t ret_count = 0; - ssize_t total_ret_count = 0; + size_t total_ret_count = 0; char val = 0; printf(PREFIX PREFIX "expect to read 0x%lx bytes of data in total\n", From patchwork Thu Jan 9 17:38:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933060 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 88CA6E77197 for ; Thu, 9 Jan 2025 17:40:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E9E96B0083; Thu, 9 Jan 2025 12:40:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 19A056B00A7; Thu, 9 Jan 2025 12:40:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03A926B00A8; Thu, 9 Jan 2025 12:40:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 9BCA26B0083 for ; Thu, 9 Jan 2025 12:40:08 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4A5611A02FB for ; Thu, 9 Jan 2025 17:40:08 +0000 (UTC) X-FDA: 82988626896.04.9922530 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf08.hostedemail.com (Postfix) with ESMTP id 588DD160020 for ; Thu, 9 Jan 2025 17:40:06 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b="JO/5voGX"; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf08.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; 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=1736444406; 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:in-reply-to:references:references:dkim-signature; bh=rFE3LTCLLZcWDz1roRpcEOSHGmZKQ3KY8sj8JWlAwYo=; b=1tG78llIZAknGcSB9s7Q3W8tzjmR9XqqOovmFVwP6hmWsj7qJ4QzNbNtIWwD3t+Gt58go/ hhK5q/hZu7nC6uHkCiKCh1yvfCl5SRFptyOxS54moy2OL51E6HDqSlmmv5l6MQWy9FrPd7 OMYXDGV7MyQa7idALpfvvC4cqNhuBNQ= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444406; a=rsa-sha256; cv=pass; b=KdGaGbys9ehOOMNG+pSZVEMEZYSQcC5JrP882+ECleEjgj+zij0x21r9LQHHtAeezgLMpZ P1oQAyhnqklASuReTUigXSqS5YaLJFSnM15NE4WE+P1EAEjff0xnnUinyVMi8PhOA7S9vK lZKOq0G4VQr0B1BXM7mNvmhGNfiZR2U= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b="JO/5voGX"; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf08.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com ARC-Seal: i=1; a=rsa-sha256; t=1736444390; cv=none; d=zohomail.com; s=zohoarc; b=FI2ZpYM2l2lhH4e/ZoKt+g/s4GJCa4puWKr6Q/8iqSEeXqL8P3ua7YLIb98EGDrUsPuTYuAFMxzPMnVnZiXRSId0OdrQGPVH1Qeh43IuFdtrS9FMxClLFXMWYf1gQIOF+nzHlFRF5KL4Zv6ty7BwwLofHU+QCcsU3eG/m+gBzCc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444390; h=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=rFE3LTCLLZcWDz1roRpcEOSHGmZKQ3KY8sj8JWlAwYo=; b=JzZW+JZQeRsw6idAdw7Xnes1PyvMbbgbY3zN2DJn/SntKedZYSeCT+VE7qyPOy/lpiWeW5Ci+Hcgy1LXw6g74SPtPbmP2OUBKvSBl4q/Jb51UKXKEipl8oEP6zh0BoWeU8ruLTqtUNFnLhxUJavNp4UsIkdCuaDxfTcWMDKz5Hk= 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=1736444390; 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-Transfer-Encoding:Reply-To; bh=rFE3LTCLLZcWDz1roRpcEOSHGmZKQ3KY8sj8JWlAwYo=; b=JO/5voGX2w0I8SSOy2/ZpKge+LyWYMK4YtdngTqOXAwJ7JdherhUWOJQy/V4sb+6 cyh55owN4fMOGxrGEXdV5nu6nIQdCz9KtvBOvDboghRYJN7AOTVWsOepSOjBmLsj1hy BTGrO39cuFi69MUD1212zJdAsZAaDSPOLSJrvGUc= Received: by mx.zohomail.com with SMTPS id 1736444388075563.3499694648385; Thu, 9 Jan 2025 09:39:48 -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 12/16] selftests/mm: khugepaged: Fix type mismatch warnings Date: Thu, 9 Jan 2025 22:38:38 +0500 Message-Id: <20250109173842.1142376-13-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: 588DD160020 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: 1pr9abgwztn6tcxr88egjwd9tmcinx4f X-HE-Tag: 1736444406-98673 X-HE-Meta: U2FsdGVkX1/eiMfrREhv/Ng/HsGLir1UuIAheaiycU3LHeOo5OdQnXshwq2hRBur6IVrMLhy3zelpbt+i1M/hEg3UDzcfcnF381uUYG1x5yxCUCbdlqBbDReRcqwU+LwSbmSyKKV2CBJ7TqR9auDVmSoHIi64NIzyxk2H1ZXSTHohJUPz2rtSLAOGaRWtbFx84m7DqHi/o+neY/cdllcEl3wwXJeOfLZ/L1TGvsgFookTvM+qsrNxe10V6mFjjOHBQIAblq1RBZLn8JWe0ForRQncNuafBQ0P/C+lwFnbV17zwoG/luR5Sa6ggj2hio4et4bb+9vVoCTagkzMJVtKg3SI9csqmLVjrWrxfbfFZIA6GKVQLHeDBn6ZGFy+zitMsLgZ27z9ad6X5ke7DFqgBidtb1nH5iw6dzresJBwlTZzvqcKWcdHimHvwZRKRMKpxrwYNmWcbUinjBGciMq9YylQ04Akvauy7wgPJagzEB4f0/KCVjZxJkDUbN5DP7/jpttwHEd5moEvvkdxCp+VmTLqBUu3E2Wk8wK+ZbmkAah5Je+B/GVh2XLUFWEI30h4+cycBfzcsBlAPN1CL1tQz6/V2JVDOf1F4dYXiWCtLQANr7HbOWVRyPdzi6UV4hhf6aZT+HGHNvwGiZkbSttjZ5wrLdoKlSeyVr9MIsW7Fbsc/25ot1dKEyr60qvJOA82FAQxNUPkWoixEQUBNsQ3nDWGBFXtXA6OGQX85ecX7DUrao9Fn1lyETItAh2og/2Z8UKzTpxnd1CvAFJCLAsMnpRjhO5yJEyrn+X+WxDkykCcWgFUA0ELW2oZFL806FnnhO6+CP1T8sCOkkZxPlsJNUfdcDWrG2Qk8zFO1m1RqYfatvFVbPUiDSLE2oKs2Dj7LuRGS+Y3RbGAk9IeKMwmZ8nI12MZfU+PNBrD+50ys04KigW/x8bjDY9gObDiZiIRleOZp2vIfzqiP9EBkF EnWybx64 Osd40S7qoyLlIwZvzC641DS9i1YLB9OBELJrmPS1lH0kKVUIO3zZhR3H543qrL+4zAWAu2A0kW3nhbjjdPCIQoS02m25h4D1JTklzPK2Hr0zhpMJzm/ggFvOArYw4N1PMG84wI+eqjRL5KOjfSLIwDM+hCeBXnixzlxGDchhbgjzrwlevkENAbK2QbbiejLnp+vojXLF0t6acJgRgRxsrRPJgNegWzpVGAzLB9XAo0FXBR6cLK5eTFe/1a++KFqwnpusfNM6J6qtSB/MNl79E+cEFt7IgxGe+g1c/X/GRD9IOVEWCoBGQ28ODYrrGqRV/O9D2 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 type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/khugepaged.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c index 8a4d34cce36b2..dde7c7fbbac2c 100644 --- a/tools/testing/selftests/mm/khugepaged.c +++ b/tools/testing/selftests/mm/khugepaged.c @@ -140,7 +140,7 @@ static void get_finfo(const char *dir) exit(EXIT_FAILURE); } if (snprintf(finfo.path, sizeof(finfo.path), "%s/" TEST_FILE, - finfo.dir) >= sizeof(finfo.path)) { + finfo.dir) >= (signed int)sizeof(finfo.path)) { printf("%s: Pathname is too long\n", __func__); exit(EXIT_FAILURE); } @@ -155,7 +155,7 @@ static void get_finfo(const char *dir) /* Find owning device's queue/read_ahead_kb control */ if (snprintf(path, sizeof(path), "/sys/dev/block/%d:%d/uevent", major(path_stat.st_dev), minor(path_stat.st_dev)) - >= sizeof(path)) { + >= (signed int)sizeof(path)) { printf("%s: Pathname is too long\n", __func__); exit(EXIT_FAILURE); } @@ -169,7 +169,7 @@ static void get_finfo(const char *dir) sizeof(finfo.dev_queue_read_ahead_path), "/sys/dev/block/%d:%d/queue/read_ahead_kb", major(path_stat.st_dev), minor(path_stat.st_dev)) - >= sizeof(finfo.dev_queue_read_ahead_path)) { + >= (signed int)sizeof(finfo.dev_queue_read_ahead_path)) { printf("%s: Pathname is too long\n", __func__); exit(EXIT_FAILURE); } @@ -197,7 +197,7 @@ static void get_finfo(const char *dir) if (snprintf(finfo.dev_queue_read_ahead_path, sizeof(finfo.dev_queue_read_ahead_path), "/sys/block/%s/queue/read_ahead_kb", - str) >= sizeof(finfo.dev_queue_read_ahead_path)) { + str) >= (signed int)sizeof(finfo.dev_queue_read_ahead_path)) { printf("%s: Pathname is too long\n", __func__); exit(EXIT_FAILURE); } @@ -271,7 +271,7 @@ static void *alloc_mapping(int nr) static void fill_memory(int *p, unsigned long start, unsigned long end) { - int i; + unsigned int i; for (i = start / page_size; i < end / page_size; i++) p[i * page_size / sizeof(*p)] = i + 0xdead0000; @@ -333,10 +333,10 @@ static void *alloc_hpage(struct mem_ops *ops) static void validate_memory(int *p, unsigned long start, unsigned long end) { - int i; + unsigned int i; for (i = start / page_size; i < end / page_size; i++) { - if (p[i * page_size / sizeof(*p)] != i + 0xdead0000) { + if ((unsigned int)p[i * page_size / sizeof(*p)] != i + 0xdead0000) { printf("Page %d is corrupted: %#x\n", i, p[i * page_size / sizeof(*p)]); exit(EXIT_FAILURE); @@ -537,7 +537,7 @@ static void madvise_collapse(const char *msg, char *p, int nr_hpages, static bool wait_for_scan(const char *msg, char *p, int nr_hpages, struct mem_ops *ops) { - int full_scans; + unsigned int full_scans; int timeout = 6; /* 3 seconds */ /* Sanity check */ From patchwork Thu Jan 9 17:38:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933061 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 03178E7719A for ; Thu, 9 Jan 2025 17:40:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 87B9A6B00A7; Thu, 9 Jan 2025 12:40:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7DBD06B00A8; Thu, 9 Jan 2025 12:40:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 546DF6B00A9; Thu, 9 Jan 2025 12:40:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2D7096B00A7 for ; Thu, 9 Jan 2025 12:40:10 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C380F1A0302 for ; Thu, 9 Jan 2025 17:40:09 +0000 (UTC) X-FDA: 82988626938.06.B615B3A Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf30.hostedemail.com (Postfix) with ESMTP id CCC6A80014 for ; Thu, 9 Jan 2025 17:40:07 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=eHeKHjTz; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf30.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; 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=1736444408; 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:in-reply-to:references:references:dkim-signature; bh=XUKQE+pYYQLtw6iu8h8iqPbRlit3OHNgXQDXtcizq18=; b=m6lTxhrwonoZRzMgPDbLWnRvHyaGxljyW18CzKGkUXbG8qOY6x92DGc49wynu+x8DByrzN 6srrLqra/y4nvKpd1rW9fyVjk5QitHOM4jqfTQKzIIw4mcSPek3EVdOVf0DMDGWjbkWBpJ IPx+jSzWgkb/tgv1oBJHPJrjghTmVGs= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444408; a=rsa-sha256; cv=pass; b=xLruyd9Qe5L7YWiYwvwoEsSGWa7Nq3mC+bEa+O3mbucKJEg20XEbWYY/QqrVRU3S2VDYZy JBi+TJbURB6I8Xcig6tBsRK8lWP9e50UhAbaRc0kmnZOjtdxAqBiTmluDaR2o8Qz0urTIU /z9YuBeP6I41Gw6cjBZ4bNfqskOLJuM= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=eHeKHjTz; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (imf30.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com ARC-Seal: i=1; a=rsa-sha256; t=1736444394; cv=none; d=zohomail.com; s=zohoarc; b=VlzaRCT5kdxtHLCSMGQmkERU8zSolIzcxLb8/I4WY1+XJLcLXFZ4OoS+D+w+FmDFfhqHjlzmE5kyPCEfHU1HynvZ8+F2D2ehyb136ZvgDVKATNwQfxgR7CKbbkJYbS0D4wbP9x6mLbirRPHfnwnToKvcafjOlDAhjCpTdg04bMs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444394; h=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=XUKQE+pYYQLtw6iu8h8iqPbRlit3OHNgXQDXtcizq18=; b=Co8na6WkeEFbKrs/k0LxXEAsXWhT/Th5GrH/sf6RBEtz3CGBW3lVglsuVNNiREVa6Lg8ourjhRt28ySDAlUJwUe8idZI94sIzDHbRpZhJK7axrhmmyjn9mf5RiF6bb+rdwxIluD21rEw5Tgy3Ux8wMumM/1AhKT07YczssWzBvs= 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=1736444394; 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-Transfer-Encoding:Reply-To; bh=XUKQE+pYYQLtw6iu8h8iqPbRlit3OHNgXQDXtcizq18=; b=eHeKHjTzhsqsZuOslb/hCZEQ5g7QV68DmaGZcMoRObOq17GCnwZNYwrGmqOmELLb TcSaH9qK60tCGL9SseD4ZKoMgREz+G/4Sm/rHWS1pk2vbTiUTWMPxl6VYELGfMHce9f D8xbR9TW8TIHh6mtvL8iM8LE9rGSIufzl5klIF6A= Received: by mx.zohomail.com with SMTPS id 1736444393092801.0156014908434; Thu, 9 Jan 2025 09:39:53 -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 13/16] selftests/mm: protection_keys: Fix variables types mismatch warnings Date: Thu, 9 Jan 2025 22:38:39 +0500 Message-Id: <20250109173842.1142376-14-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: CCC6A80014 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: wnm13yo5fpoiniu69b6b7k1ot56btm4w X-HE-Tag: 1736444407-464050 X-HE-Meta: U2FsdGVkX18DTxaUKxwqiPNxvisI/BZY2seRlU+44YBnLWjTgt4BIIf2bGa+n5NUvJayq5CU1RuUB4VBGMtIV+Nwba/Shpy6+i8viwvfWhLyxDZN9lRTl8NnwWROIpINZkNwk5uqHQK9vexefqwzKp1FRtF9oEQY6gUpvPP4TnYNFT6v1lxO/LvG7Q2KW2q7esVYmTrFRveesYZK0zp7J7vF3KeAAC77pJOmz2bt/4znvUi/cCM4enQKIiIVDdQH7WRYv+OnJY0HJua2qLRUeO8FLvrK1SXydwYgbvvg3acDHDLHMLWzBg+6p/Qc40Djn9vF8VZ+0a8p9BS2KceO3r6YBApphySh/oHkxcZHbnO7ZwK2+vOJND3HUjTwK7caoiVr981MlJaQQKv6XCoAgPfEH2yuic30pMSunHzy/wcJ3Vp9RKBgAVhVlkDsFno/akAX8mXnJ0mw0z2StcxleaXoS1Yg+fUMgk8WiE4ZK0xWpDv/6bfhNp1TQnVHDhkTh0ar62OEvF2Q1TY1BaII2dICc1YE8JLwfC880H8uGV2r8NSKaNQxOUK0G9SOvIE2zFKr4pZBRyKCLOjqGNmYD8a1QI1sy44C31L3KM/qKMUsaRN/nwaRk2cKr703Mamu80rDOF7XTzx8oXCXBvsJ/q/mwc6PYnR/cTrh2UpXJo+W+ZSzQsFH/LB5O18ajR0U/p8QA+vJo2LyA4hvGOrfrponLKJeDmBPtTRjXIED6v3wtd8xqnKyjUczshymEpBb2K4uCPExYkpfBgduRWzs8De+VpbNhhbIFp+jQBwb/ZTE25euSdAStUp91pbTMTzHcUUU8z/Ico/YEhXRursWGWE0GW6mhXB/6ncBtC5AiYatFwETX+aocINbmbehouLxzRoi+SSfPoyMptHy4uxRkGfmZDa/ObDIL9Y+s/h5rvYIpRm7OygjsH2abjKCN6zNLHaM+OnbSaOHpzBl2NN 2E/JzHy5 0I73FLkRU4B/J6YkFSro1UvxVctqKFaCVb4BF4RieHz0gKh0eXNC7GcHlQRILkERna0RAHnJBLyCaCSJApTbpbqwiP/juzGHztKuH2N6kYxPB70dFh5UBdGx4ksWvDieKTYzqoAhQ3a61vtcAieWCYJ15vZPbhmg8dWrHSVMI6lN1BmbkSiQp4coOu54AO2vSU2B+txeOm+jjRu9Jln73ZarDPsnUFzJ/LC9Io2aPhk2SFeDsgZ6MBLQoScGntqPZ8DrR8gW8DZK4tLymvTUDARL3ks9VCvo2/FjQ69X8OuPBV4ESBB5dlbHQ+SNeQ0EMSGbv0ly51CXzGRP4fzjBhuUjDmSeqx0oyB/5GXP5DS2OWeksz3VZ7dF9ag== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000133, 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 variable type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/protection_keys.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/mm/protection_keys.c b/tools/testing/selftests/mm/protection_keys.c index 3a66798a8e8d6..ab1e586bc2728 100644 --- a/tools/testing/selftests/mm/protection_keys.c +++ b/tools/testing/selftests/mm/protection_keys.c @@ -78,7 +78,7 @@ static void cat_into_file(char *str, char *file) } ret = write(fd, str, strlen(str)); - if (ret != strlen(str)) { + if (ret != (signed int)strlen(str)) { perror("write to file failed"); fprintf(stderr, "filename: '%s' str: '%s'\n", file, str); exit(__LINE__); @@ -597,10 +597,10 @@ struct pkey_malloc_record *pkey_last_malloc_record; static long nr_pkey_malloc_records; void record_pkey_malloc(void *ptr, long size, int prot) { - long i; + unsigned long i; struct pkey_malloc_record *rec = NULL; - for (i = 0; i < nr_pkey_malloc_records; i++) { + for (i = 0; i < (unsigned long)nr_pkey_malloc_records; i++) { rec = &pkey_malloc_records[i]; /* find a free record */ if (rec) @@ -866,7 +866,7 @@ static int nr_test_fds; static void __save_test_fd(int fd) { pkey_assert(fd >= 0); - pkey_assert(nr_test_fds < ARRAY_SIZE(test_fds)); + pkey_assert(nr_test_fds < (signed int)ARRAY_SIZE(test_fds)); test_fds[nr_test_fds] = fd; nr_test_fds++; } @@ -897,7 +897,7 @@ static void test_pkey_alloc_free_attach_pkey0(int *ptr, u16 __attribute__((unuse int max_nr_pkey_allocs; int alloced_pkeys[NR_PKEYS]; int nr_alloced = 0; - long size; + unsigned long size; pkey_assert(pkey_last_malloc_record); size = pkey_last_malloc_record->size; @@ -1280,7 +1280,7 @@ static void test_pkey_init_state(int __attribute__((unused)) *ptr, u16 __attribu */ static void test_mprotect_with_pkey_0(int *ptr, u16 pkey) { - long size; + unsigned long size; int prot; assert(pkey_last_malloc_record); @@ -1530,7 +1530,7 @@ static void test_ptrace_modifies_pkru(int __attribute__((unused)) *ptr, pkey_assert(WIFSTOPPED(status) && WSTOPSIG(status) == SIGSTOP); xsave = (void *)malloc(xsave_size); - pkey_assert(xsave > 0); + pkey_assert(xsave != NULL); /* Modify the PKRU register directly */ iov.iov_base = xsave; @@ -1727,7 +1727,7 @@ static void run_tests_once(void) int *ptr; int prot = PROT_READ|PROT_WRITE; - for (test_nr = 0; test_nr < ARRAY_SIZE(pkey_tests); test_nr++) { + for (test_nr = 0; test_nr < (signed int)ARRAY_SIZE(pkey_tests); test_nr++) { int pkey; int orig_pkey_faults = pkey_faults; From patchwork Thu Jan 9 17:38:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933062 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 D8F0AE7719A for ; Thu, 9 Jan 2025 17:40:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 658846B00AB; Thu, 9 Jan 2025 12:40:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 608126B00AC; Thu, 9 Jan 2025 12:40:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 481296B00AD; Thu, 9 Jan 2025 12:40:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 265AA6B00AB for ; Thu, 9 Jan 2025 12:40:16 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id DCB561C6A07 for ; Thu, 9 Jan 2025 17:40:15 +0000 (UTC) X-FDA: 82988627190.14.4593888 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf25.hostedemail.com (Postfix) with ESMTP id ECDA8A0009 for ; Thu, 9 Jan 2025 17:40:13 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=OqtrwqmQ; spf=pass (imf25.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444414; a=rsa-sha256; cv=pass; b=INgZ5+SqIJ+dCsFLNLPJgkwmSVjGXM3b8V+PZp4+y/XpbFYHAdtp8XQT4xGLclTc/ViO1I VqnNgmK4o2JFde6inMILQisCyVXTZDWH6bjcZM/7W0Y1wUq9Cp1doSx9OotST83sBaTilv hheyuJr3RRyIH1Uu1JW/uet8N1LylUk= ARC-Authentication-Results: i=2; imf25.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=OqtrwqmQ; spf=pass (imf25.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736444414; 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:in-reply-to:references:references:dkim-signature; bh=jExE7sSKlOBw8hiTubKK6vBM62dOLKsuL/Hd624njm0=; b=ig/+AxfXHfQ2hLjlKpaB1L+btqFd+XWFchuSKjpaXLfvlBql/EVu4n3/WQMqNVCsO0bhNS ka6Q5I3A5MzkgtkfqG6/zEoNb0Bwj1e/0DFJjpedxedtEqSy3TDsJuWJGf1NmRtqKtaFpl FcA3jNZEykwQd4Zbtq68f4LmhQu7nS4= ARC-Seal: i=1; a=rsa-sha256; t=1736444400; cv=none; d=zohomail.com; s=zohoarc; b=RKT/gDA02p5jlVeA0ZbGdM6gvQ1lXql/mRPcPhYmrgpAWdlBYGw/6R1eHKPUaICqGTSQsuCwjzQ+BblY+QHmUwPHgGtfm1nKB/tuyz3joF6fCkRmSnK5dD4/vDQtb1dfvy4YFpjHUv/CX+lcWMm1qEViRaKb9zeE3qhmaV8zktc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444400; h=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=jExE7sSKlOBw8hiTubKK6vBM62dOLKsuL/Hd624njm0=; b=mccv1hFXvmsaa923Bm/zl8be9pFJqVhaz6+MXRnAbEJIO2QwYY8dUf8Nzzdo56yIWHwVXAe1MVNOdXG3j4btiny4SRCjxCbRvYKhLDIbP4Yo0pot8QghDP+soM9f+iaaYFEdYOVM1M7CgEhfxFyZreTokRLIDgpNbOdSwjGrZR8= 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=1736444400; 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-Transfer-Encoding:Reply-To; bh=jExE7sSKlOBw8hiTubKK6vBM62dOLKsuL/Hd624njm0=; b=OqtrwqmQveeDkFGdhTZ7RPC8k3KFXiDUsZQ+0JYO9UXiSr4piapx1Q3hAVYr4bbm wVl9zGA7DV2gmu2tXYAoy1E89945Czf4gC7qPh3JFs0u/uJpGEBv9szx5xtTl/BIdnW 6x1E0vqVaF0ZRTYEJwHHsybiJhTs/JzKMtkNyBTg= Received: by mx.zohomail.com with SMTPS id 1736444398626830.5404799734731; Thu, 9 Jan 2025 09:39:58 -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 14/16] selftests/mm: thuge-gen: Fix type mismatch warnings Date: Thu, 9 Jan 2025 22:38:40 +0500 Message-Id: <20250109173842.1142376-15-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: ECDA8A0009 X-Stat-Signature: 4xpitf56sccskfojoew7cajcz63mqct1 X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1736444413-736621 X-HE-Meta: U2FsdGVkX1/kbnR57GK4I3hJZnUbPuK12qpTL51GDfnQItJu7Ebt4iJGDNwJ78aBlKULNqt1U58UaGkhvKwnmvbYCQtm43vVU1Zr58/Xg7UG+MxBjEzWdn2ZW1rpTOxsqPkGsCm3Cxn81K/M4Aa/+46t6Uk4oTx7YxkglitWzJc7vatyHyl0EsbP9/hRn9oX7zlOu7ODA+PiacYJiRfkaVtNxfSM90fmydl6ishlQqzi0jjK3lzDBAty94fayyeu3OXdy9w+qL+NluZqjO9X8fuOg5YP3748SaxEfC2icDgHaU7PM8zyfjzEVs892WMAIFQ9SkzTssbbefQLbxWX5HkzeKxQ06baGvIQgo3fVpRrvF8DOqzhUZTVPfVj05iWaIY/TFn5GiU0/cgEcHdpLET4rto24ftXdpc+PFmGMtbGnqUaNwV5Ikzj7VMkFS/6eNjh1HKFlvYyoSgvkFbcOyJFu7CZk4ZuTpW+D7zxSm2LEjJS7ZWcVzqfFOKolwGXmpeXjaYyYjvZ+tlxou5FPKMHmSIH9pmTCx8sn6eF8LkOeYlolUxfsJS5e7e8rBN///Av3I66mhXX8l1BSsBRmmryt29Nvz0fp3u+6Rn9ztX8BdhKzbKMD/hHmwRVEIFJ0zIb1ABfjEbvvHAE/th5pIFhAQN3wne6HuPgCG/3gZpGPy7LumShWFn67bl6XMrpZTfOZVkqpkoDqUHE0szfSOyQ8rGElAtZo1zvxfEMLtBmL1bIOFLFlFPOIHpY97vrnDfVFf/4qtGTzc7BGvO3165+IOhCxSpPfEcOZnZ1l31RU/SyLxdGhLCB30Vb0yLYCAs8Tw1bHgMFBwrnsCwbQjOQN2ltjV73ID4vNsIAjirSDaTJIyO+hpvHEBsc7v0TqtsXCGg/PfPqEHWwV4nCg+3GI9D6DbeKcdE0ciuBxNAEJQATW9LrtFtB7T10S6/IRk0XHZEN2CjZXCwpAhk fhmZXyY2 I0/WdIh/g17EOSwfOAaf6WKzarh5NF6gcxiP0VLswJ43/H6/4HnV9NXIinY8U/DVMl8vb0hRQyyZKdE06Fct4Z3h7qARl6UhPsrB530IVk0I2qFAniXlhXtnUigAgQtMo8d1k9Tp11sP/NpCa5eMmDfLh1X7PxlLpk7dXWlMtsyFFBPoyIOztWX4vThr11PQdkfTTfQAFnLdmfh/q4funajNFipNQZXgtINwSdqn0inE1BoXybq00vQKBrGaDrn5En6v4hC/zNVa0AURz4pStVfTad7weYtgD1gXIAZZyaU+i9xg0mmsPczL1U8oAmYPN+I7x 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 all the found type mismatch warnings. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/thuge-gen.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/mm/thuge-gen.c b/tools/testing/selftests/mm/thuge-gen.c index e4370b79b62ff..515b89ac4eb59 100644 --- a/tools/testing/selftests/mm/thuge-gen.c +++ b/tools/testing/selftests/mm/thuge-gen.c @@ -65,7 +65,7 @@ void show(unsigned long ps) { char buf[100]; - if (ps == getpagesize()) + if ((signed long)ps == getpagesize()) return; ksft_print_msg("%luMB: ", ps >> 20); @@ -106,7 +106,7 @@ unsigned long read_sysfs(int warn, char *fmt, ...) unsigned long read_free(unsigned long ps) { - return read_sysfs(ps != getpagesize(), + return read_sysfs((signed long)ps != getpagesize(), "/sys/kernel/mm/hugepages/hugepages-%lukB/free_hugepages", ps >> 10); } @@ -126,7 +126,7 @@ void test_mmap(unsigned long size, unsigned flags) after = read_free(size); show(size); - ksft_test_result(size == getpagesize() || (before - after) == NUM_PAGES, + ksft_test_result((signed long)size == getpagesize() || (before - after) == NUM_PAGES, "%s mmap\n", __func__); if (munmap(map, size * NUM_PAGES)) @@ -164,7 +164,7 @@ void test_shmget(unsigned long size, unsigned flags) after = read_free(size); show(size); - ksft_test_result(size == getpagesize() || (before - after) == NUM_PAGES, + ksft_test_result((signed long)size == getpagesize() || (before - after) == NUM_PAGES, "%s: mmap\n", __func__); if (shmdt(map)) ksft_exit_fail_msg("%s: shmdt: %s\n", __func__, strerror(errno)); @@ -173,7 +173,7 @@ void test_shmget(unsigned long size, unsigned flags) void find_pagesizes(void) { unsigned long largest = getpagesize(); - int i; + unsigned int i; glob_t g; glob("/sys/kernel/mm/hugepages/hugepages-*kB", 0, NULL, &g); From patchwork Thu Jan 9 17:38:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933063 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 409E5E77197 for ; Thu, 9 Jan 2025 17:40:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0E776B00AD; Thu, 9 Jan 2025 12:40:24 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CBE3F6B00AE; Thu, 9 Jan 2025 12:40:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B60466B00AF; Thu, 9 Jan 2025 12:40:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 94C316B00AD for ; Thu, 9 Jan 2025 12:40:24 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 4B2B01602F0 for ; Thu, 9 Jan 2025 17:40:24 +0000 (UTC) X-FDA: 82988627568.30.4218824 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf29.hostedemail.com (Postfix) with ESMTP id 4AA3812000D for ; Thu, 9 Jan 2025 17:40:22 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=E42plzwo; spf=pass (imf29.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=1736444422; 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:in-reply-to:references:references:dkim-signature; bh=CeHZ22DeRcbYzVqgFrIGCzYTZL3s2f2EUGStcqAuXWw=; b=X4p6YZLMs+0MFyrZjFObBKekQN/Rs756gWzwQUlGYSDRH010vpySGW8jtsh3xM8zVITioH hj0xxROdwlysDoc2IxEmMlRNeq3b4DhQ03S24+JRpG0r42OzdXlDSVN5O8Whb+HiqRq4Dg KrunYZzd13YojzHXmkjSDnUQ++2CqHk= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=E42plzwo; spf=pass (imf29.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=1736444422; a=rsa-sha256; cv=pass; b=yQUkwZlpGpS/i+L2v4F+yuoG4mAmta+FWw7bu98aBnDJSF26A88SruH5V/DVmaK8jrrGpU X5q5wc+pWoLsCvZC0JU1TAHoU/O4vSRKVviXMfxrbgb1HKwRmrMwtD1+7/c/MxVIlvUDjp 8bzYgH94luz/hMduAkhrBwgOhLFFttg= ARC-Seal: i=1; a=rsa-sha256; t=1736444408; cv=none; d=zohomail.com; s=zohoarc; b=EA96Fos4BhL2pPCfCvhDOGRlyxxT1MkPpiO4QNlECeC0D28p7B6/iJaOgfw4SgWGglX2Y3XSE/sBz/rAM9McoIjzPo44zNDG+woARIuIduahd6ZpYzJAg9hlBkMU1lUbViy/rjT7Jm6M3z3+mJPFsUezq/hCCHvyvoMTkOTpSvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444408; h=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=CeHZ22DeRcbYzVqgFrIGCzYTZL3s2f2EUGStcqAuXWw=; b=QoGmpsBPt1rQgSWYA+KTSGfCOR5BggWu1E95AwxFKv4EgsIyMkzPcdWAjvHHhDe1gmMcQs2FaySvML4du+wvgRuDVgFeXtgR3GO3IsMhwMYp8UMdZZYOTjQRIkONbJoEGAeL1hw4xd3sAw05CI7+I4CfHrrENWHUTVZxNqA2ylk= 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=1736444408; 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-Transfer-Encoding:Reply-To; bh=CeHZ22DeRcbYzVqgFrIGCzYTZL3s2f2EUGStcqAuXWw=; b=E42plzwodXz91pjg1bgn90hvwF78JGAIljtjn7PZMAitJ8hRSr2yiIoCeJZsFgJC ckmgDtP4qT/Ry+FpcwT0KsXqI1UKC07vh7upsP+dwKvjCTdLDJKHQaKVJsv952MgqRS /g1yACduicG6hPfMZWQ95JiHapj4goG8W6lmVlBU= Received: by mx.zohomail.com with SMTPS id 1736444406712435.8462214370427; Thu, 9 Jan 2025 09:40:06 -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 15/16] selftests/mm: uffd-*: Fix all type mismatch warnings Date: Thu, 9 Jan 2025 22:38:41 +0500 Message-Id: <20250109173842.1142376-16-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: 4AA3812000D X-Rspamd-Server: rspam12 X-Stat-Signature: e735kftt46wzdskhrrjf6sqn5aexxrdq X-Rspam-User: X-HE-Tag: 1736444422-444214 X-HE-Meta: U2FsdGVkX1/vaf41JycGxXv8PZ6V7VUopOmR8KxNP6DdqXdb999ktjTTaWLFqr09BT672wajjFANRRbUI6/nXaF1Qy2qJGc+plGcsarxwC/bIB6pkZ2H08z6lMSMrgNyJ/ooZhhqyeCg/Dq83/i4JkC1zSjfpKo/m2OtNCTGY2qSEqsuoxM0A3kWGTEXFPs+nQ0OAMjpqUu5tUbpgpi+wLSaAnWQYgcl/sDHxI6DJx5E7wHlDrOVo4WwKARxEL+Q/uBakt6k0aVNIbkHHCoMIbd6d4eSPRBkQ4o+4eyhowWvlZXDENNfDu5TJoG+PmjO6IRzXpCHuZA2IFmxNWF1YR64s8/fmZoCmiS+oRLEfPlz6DhrnCLhWsC+aJQC+RmzQWh+a5Zy4xaAlgRqJXq6/VvTA3fyHm/kXO8r3Ump6fkoSedndwkW14IdOpgsKBhFZ4Ppcb/I7M2k79+ZClp12Wp1kOcW3qsZD62fl3bUHCoZM+tJalghwvlUhL/yvBshEoMv03rTNEuVvXTXEf6wUsI4crw7cnNmg+SDde3Iz78kInlK4BgYGm0QDoSeV9f8615GDT2EH5lxI6AXD8ASgbsZ2DN7N7AGoE5WhMJaD5W3yQBjp5yNiFLbF5c1EdezFofoqMJW2T96RgdYkK3Hv+0X0lD56Sae4nz4jj/SJ0TxEMDIJhWZZ7bNf6MpEw1uW630ke8sCcBqibcOc4PGaziSNV9SDR3xniagcSbi8qqeny3zYazYngfZ7HyYQwMFg9CfxavR4p5VknVXNEiQb0nR7jhR/umgAFauEKhflSyAL0L2iXcFViuaQmlEjRo5wQs6ONUbS/4Mv6jmahlIZmJEYydHBqmZtD/KgjHRuEhl+W4bRftIYo7x3XfMhGqnTrih6V1kkE0rXTiK+qkGyTPXYW+9tzwtdDInWIlTLccP0iZcMZKRVgG45BmH6fD3TxWUk7kYl1uEkhy/HHG IC5Icu2c CqdXlPPxvnoOAg2FzIDu9OTSvE4/IAdumsSBFyvDkAEpneZOAmX3ughmeSDRuLATooCGwrIxMMnpseN3XN1dTPHUZTBJMv+/Y9MxmLitiRCZS9VfJYFlMIj0b9DBwwwYPK//FYv75+rE4jUWXPdOWtBbrbPpipBKF5ZcympCo2zkGjMVCgJdELb9ycNs+ZqxTF/Oat/J4Fk053t1YEKWXLU9wwYN7S1u2/t1D0/zNMwF9MmzztUUFyxgj6bes4FEHGjNDmsOrGCfg4QDjmQgdSLZrYGafQKzU9nmTw/hAz8rJkNzg81z/lBVta2XLoyCL6ozaYAcElFRPHpw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000025, 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 all type mismatch warnings in all uffd-* files. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/uffd-common.c | 6 +++--- tools/testing/selftests/mm/uffd-stress.c | 2 +- tools/testing/selftests/mm/uffd-unit-tests.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/mm/uffd-common.c b/tools/testing/selftests/mm/uffd-common.c index c15674a60f299..47bdcb47481ae 100644 --- a/tools/testing/selftests/mm/uffd-common.c +++ b/tools/testing/selftests/mm/uffd-common.c @@ -450,7 +450,7 @@ void uffd_handle_page_fault(struct uffd_msg *msg, struct uffd_args *args) args->wp_faults++; } else if (msg->arg.pagefault.flags & UFFD_PAGEFAULT_FLAG_MINOR) { uint8_t *area; - int b; + unsigned int b; /* * Minor page faults @@ -621,7 +621,7 @@ int __copy_page(int ufd, unsigned long offset, bool retry, bool wp) err("UFFDIO_COPY error: %"PRId64, (int64_t)uffdio_copy.copy); wake_range(ufd, uffdio_copy.dst, page_size); - } else if (uffdio_copy.copy != page_size) { + } else if (uffdio_copy.copy != (signed long)page_size) { err("UFFDIO_COPY error: %"PRId64, (int64_t)uffdio_copy.copy); } else { if (test_uffdio_copy_eexist && retry) { @@ -655,7 +655,7 @@ int move_page(int ufd, unsigned long offset, unsigned long len) err("UFFDIO_MOVE error: %"PRId64, (int64_t)uffdio_move.move); wake_range(ufd, uffdio_move.dst, len); - } else if (uffdio_move.move != len) { + } else if (uffdio_move.move != (signed long)len) { err("UFFDIO_MOVE error: %"PRId64, (int64_t)uffdio_move.move); } else return 1; diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selftests/mm/uffd-stress.c index 1270ff3104cc6..5509ec32c3290 100644 --- a/tools/testing/selftests/mm/uffd-stress.c +++ b/tools/testing/selftests/mm/uffd-stress.c @@ -77,7 +77,7 @@ static void usage(void) static void uffd_stats_reset(struct uffd_args *args, unsigned long n_cpus) { - int i; + unsigned int i; for (i = 0; i < n_cpus; i++) { args[i].cpu = i; diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c index 81b315bedb744..c3d59ec754040 100644 --- a/tools/testing/selftests/mm/uffd-unit-tests.c +++ b/tools/testing/selftests/mm/uffd-unit-tests.c @@ -917,7 +917,7 @@ static bool do_uffdio_zeropage(int ufd, bool has_zeropage) else if (res != -EINVAL) err("UFFDIO_ZEROPAGE not -EINVAL"); } else if (has_zeropage) { - if (res != page_size) + if (res != (signed long)page_size) err("UFFDIO_ZEROPAGE unexpected size"); else retry_uffdio_zeropage(ufd, &uffdio_zeropage); @@ -949,7 +949,7 @@ uffd_register_detect_zeropage(int uffd, void *addr, uint64_t len) static void uffd_zeropage_test(uffd_test_args_t __attribute__((unused)) *args) { bool has_zeropage; - int i; + unsigned int i; has_zeropage = uffd_register_detect_zeropage(uffd, area_dst, page_size); if (area_dst_alias) @@ -997,7 +997,7 @@ static void do_uffdio_poison(int uffd, unsigned long offset) if (ret) err("UFFDIO_POISON error: %"PRId64, (int64_t)res); - else if (res != page_size) + else if (res != (signed long)page_size) err("UFFDIO_POISON unexpected size: %"PRId64, (int64_t)res); } From patchwork Thu Jan 9 17:38:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13933064 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 5D8EFE77199 for ; Thu, 9 Jan 2025 17:40:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E1F056B00AF; Thu, 9 Jan 2025 12:40:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DCFA26B00B0; Thu, 9 Jan 2025 12:40:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C70BB6B00B1; Thu, 9 Jan 2025 12:40:30 -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 A4B496B00AF for ; Thu, 9 Jan 2025 12:40:30 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 65DA6160300 for ; Thu, 9 Jan 2025 17:40:30 +0000 (UTC) X-FDA: 82988627820.13.95C1B89 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by imf17.hostedemail.com (Postfix) with ESMTP id 040854001A for ; Thu, 9 Jan 2025 17:40:27 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=IGHq1TWY; spf=pass (imf17.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736444428; 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:in-reply-to:references:references:dkim-signature; bh=xbevEof0duXdPukRg64fWg8r3pNNC6hhoZocH1wOXRU=; b=GgqttTbkPwEjGiqFsdCYjMLMlB6jCGe32jo9/5B5fXU1faDyWYGH7y8HEW5rAu3sZ2NnwC pgyQO6CBwsekJeQvzYvB6MHcK+DtCjIWrdVibnPLjJOBR6pXWwp8O5SIUadrXAORo+NbMx Oni1k+2fjwC7rnQbEKvdm2/xdmjljS0= ARC-Authentication-Results: i=2; imf17.hostedemail.com; dkim=pass header.d=collabora.com header.s=zohomail header.b=IGHq1TWY; spf=pass (imf17.hostedemail.com: domain of usama.anjum@collabora.com designates 136.143.188.112 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=none) header.from=collabora.com; arc=pass ("zohomail.com:s=zohoarc:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736444428; a=rsa-sha256; cv=pass; b=e12J+JmMDnoRdStYJk2fGKIR0vEuU2mho/CioDn2dT5sqDQCZfRNjfSRpXy0jGV0xcwWye MOy1OLycHmQoEdscPPd09mcHYyfIY4QAkRi6N1Gy2hdcEvUzYM3zVV06hymhL/rzSoQ1ad 1Qs5exFDJlrC3SzlOM23jH8YJ4paPH8= ARC-Seal: i=1; a=rsa-sha256; t=1736444414; cv=none; d=zohomail.com; s=zohoarc; b=PBKPPCDCtFUSbvwEA+dM30ZUlOyg8CGjCb4bNH+l3Z9tj457RqYurRZYPqgFRgFQER9IeW1bXjTI6p+qUkE5tcdh+6ur5L5HD9UVvCPTfQo5lE9q+YFPqEAwAGZraoQo3rlVp2er/Ss425w5Igj+T4JCNkiVdy1t8nG+SxVJook= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736444414; h=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=xbevEof0duXdPukRg64fWg8r3pNNC6hhoZocH1wOXRU=; b=T8NTH9UVPUu8OimEOPe/GCeUgjKd1VM1wL/zIzSZh7mGKGVbqPm/oN1P7w+vm449XhxwbpOhJo5i7TtdF187f1AwLSEOfu0FpZoTIiLQ1yYN/tYzRpWzSuSxQDg1N9wAg85LWrZJFkX3IToiX5yNY5EC8Z7bgo/BVXJuk0s9oOE= 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=1736444414; 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-Transfer-Encoding:Reply-To; bh=xbevEof0duXdPukRg64fWg8r3pNNC6hhoZocH1wOXRU=; b=IGHq1TWYopiUOIH2rYweRqWsO3Le0EKf3rjrw1rcvNjecylNL8KffSRkrTjoMBrU XSirTpC4sqxpEaQR7dZWm57+mY7GZ3V5rC6zVpzTJeUm+VV8WU8eHfQH4Na1xUnU2Dv dOGbVqRhnTVb7hrTdvxAnIuT6bxw0Oid88fjB8aU= Received: by mx.zohomail.com with SMTPS id 173644441288525.56642632894159; Thu, 9 Jan 2025 09:40:12 -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 16/16] selftests/mm: Makefile: Add the compiler flags Date: Thu, 9 Jan 2025 22:38:42 +0500 Message-Id: <20250109173842.1142376-17-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-Server: rspam05 X-Stat-Signature: u4pkmc9rogmytjfkxatwie7rtg4ujgsj X-Rspamd-Queue-Id: 040854001A X-Rspam-User: X-HE-Tag: 1736444427-530366 X-HE-Meta: U2FsdGVkX1+OjlW7GohpAZvCUHkGp1zxJWu51iF+iDq8yMhctukxNepR1XOMLtGzVUpUWoIrdPKmHE7mzjxp+7QY8rG6qeo6EZV2Q7sgBQIuQWSlJ3Af/UbM8Tds3xVTzmeXG/7QlSNTFhU5s0pocZ+1gH1IROiW1rrYeU17RHuAaXYKrNpNrhtZi+2FcfTEuLBlKI5y8mT9K3BZe6H5Dyl5K1jc/wO+OJ4kF1YAGaVLanFS4uwQIY3PfxcY67CUbIuRvogtBhl8CTmYYlTLQrX/pSOt1gbCYd+WoNUMteqP/IORyucQCjlTwbwZ7aFcTW4aNq5P6rr6V7c5Jk0WNc1JEZRFXlc2W6zN+2pAOSVEyZpK4ffJJL1g5rBMrYAud04FawE4DI+hlnwUKQpJKv+URbNu7kA5ZxAkcqgyjF9WUP/cb9XSeScMZ9Bn7N6SfLJLSmmrELPx6/oaH8so3Iwxkrixe+TBhne8kkhjgdjU1BOLFi07exKKwUcODRrUq6fjvN3cbpKNKepoyisij3DDFvfoCsYYcqx/I4/m2lFxoLDH8Qq97An6Ne2ooRF3OHG5IyoycxonCpHDzTifzq/QvcQJlE6LY5WKMt9IcjLo+SGIpCWbAyDx2kA5uZPkOsI6PK3CLhTi32EVAmctUBZkZ2TSvJaFttFob26IH6prV1u41MAg2fD3Tq3qYHDWnKRBFkVX5YyDc4gLIYZFF4/Fxb/jNGz8qACp9HxiW28A+KJGgMILNhzZ5iEk5UQ8miQKshsPHx54ixHhhxEs+kf72k++HivSca++awxaanEW7PkwgDK1QMWDgqLNtZZ2RrElT6HWDv0QIBHbENSvNpFiy2aTwcGNeAbBEZ2g5bQBUizyESnyz95DpFkjzGJ9RFH0gLX2mgooadCJ8g1pO363ZU+DykOkQx26EVnI2MSMCDfkKJMNBfzt5/ycc0z2GtmilRMde9z7oc5kn9L Yz1AmpSv fiZgG/X0TX8ub8yo8bAVFIhFFdew/p0KnJacKLIko83jPGH6iRGbWdGs25sHFiWK6Oh9BltSt2bspY2kAEQhHLdJPKVHLGW9hmru3aobeZEeW1UjG+EnrV1L4q18ifFScVwKP/tLAmoKFKCGNL5CRYAhwuhoHfhimBL+x8N3emfcoX3yA3shz9fLczudbyyAzgnpxmBE0QT9nFz934wALXSpxd5lsvVP2tSDE5k3FhzvJL5uhe8TXC0Kw+3daJ+cQnpLR1i7SLKv/3rDkwIiOLGIiKGbUV4irOpGxfd0/yvayq645apAR55ubsEM2DD63R7Dw X-Bogosity: Ham, tests=bogofilter, spamicity=0.001294, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Add the compiler flags to catch warnings during development. Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 63ce39d024bb5..006ed2e8df87e 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -34,6 +34,7 @@ endif MAKEFLAGS += --no-builtin-rules CFLAGS = -Wall -O2 -I $(top_srcdir) $(EXTRA_CFLAGS) $(KHDR_INCLUDES) $(TOOLS_INCLUDES) +CFLAGS += -Wunreachable-code -Wunused -Wunused-parameter -Wunused-function -Wunused-variable LDLIBS = -lrt -lpthread -lm # Some distributions (such as Ubuntu) configure GCC so that _FORTIFY_SOURCE is