From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B14EB1D8A0A for ; Thu, 7 Aug 2025 03:44:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754538293; cv=none; b=C/2W5o8d6sfU6335R62Cf89bH3iGUWk1f6BbfHk4AAgUrX56uVpo17/cSUBCJ3wUPMhuuzF1tU+/R6gNGxbhb2agNAuBj7WCzmmYDt1l1ZzVhI1WLwGjqu77h8wlR5hdOpufJarld1GTqdgNqze81R9TSdRMsgm+mRIbwUYsfzk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754538293; c=relaxed/simple; bh=U5Jw6eRlJC4s1pUPuB5v0vSwsxg2giLSSXJHwryl/pA=; h=Date:To:From:Subject:Message-Id; b=ZtKz/8hywW58Owdz8ZUxt79GoJvHTlvK5v7aEiYgJiqquflQo1Kddb8A4LWzy3lmkw3ms53X7G12sC1+0xNnToz3n9B6XRbnZQ+7nIMBVvx55uyZ2hD7CLgjUzzqyA9HYYJGmhPX1Il97Q7jq+lykJ4j0n8DGc0xc3t040Bq15Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=vT8Rop01; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="vT8Rop01" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D240C4CEEB; Thu, 7 Aug 2025 03:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1754538293; bh=U5Jw6eRlJC4s1pUPuB5v0vSwsxg2giLSSXJHwryl/pA=; h=Date:To:From:Subject:From; b=vT8Rop012Al1nyh/vSdlgAJgTPv0DCHUQLAwzYsVXngCW2Fh7YfXvLsYSZeX39d7H 41TZZxE85dof2hPHFTMrB6QZuL2ZW6B0AN1AOwGp4MKQ+BAArVzu2s6znBcWnhnmHB HL9TXs2eP86S7vOcECyHNC51LwtGaM91Vcgjh6b8= Date: Wed, 06 Aug 2025 20:44:53 -0700 To: mm-commits@vger.kernel.org,ziy@nvidia.com,vbabka@suse.cz,surenb@google.com,sidhartha.kumar@oracle.com,shuah@kernel.org,ryan.roberts@arm.com,rppt@kernel.org,peterx@redhat.com,paul.walmsley@sifive.com,palmer@dabbelt.com,npache@redhat.com,mhocko@suse.com,lorenzo.stoakes@oracle.com,liam.howlett@oracle.com,leon@kernel.org,jhubbard@nvidia.com,jgg@ziepe.ca,dev.jain@arm.com,david@redhat.com,baolin.wang@linux.alibaba.com,baohua@kernel.org,aou@eecs.berkeley.edu,alex@ghiti.fr,usama.anjum@collabora.com,akpm@linux-foundation.org From: Andrew Morton Subject: + selftests-mm-mark-unused-arguments-with-__unused-2.patch added to mm-new branch Message-Id: <20250807034453.7D240C4CEEB@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: selftests/mm: mark more unused arguments with __unused has been added to the -mm mm-new branch. Its filename is selftests-mm-mark-unused-arguments-with-__unused-2.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-mm-mark-unused-arguments-with-__unused-2.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Muhammad Usama Anjum Subject: selftests/mm: mark more unused arguments with __unused Date: Thu, 31 Jul 2025 21:01:31 +0500 Mark the arguments which cannot be removed with __unused attribute. Link: https://lkml.kernel.org/r/20250731160132.1795351-8-usama.anjum@collabora.com Signed-off-by: Muhammad Usama Anjum Cc: Albert Ou Cc: Alexandre Ghiti Cc: Baolin Wang Cc: Barry Song Cc: David Hildenbrand Cc: Dev Jain Cc: Jason Gunthorpe Cc: John Hubbard Cc: Leon Romanovsky Cc: Liam Howlett Cc: Lorenzo Stoakes Cc: Mariano Pache Cc: Michal Hocko Cc: Mike Rapoport Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Peter Xu Cc: Ryan Roberts Cc: Shuah Khan Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Zi Yan Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/hugetlb_fault_after_madv.c | 4 +- tools/testing/selftests/mm/hugetlb_madv_vs_map.c | 6 +-- tools/testing/selftests/mm/pkey-arm64.h | 5 +- tools/testing/selftests/mm/pkey-powerpc.h | 2 - tools/testing/selftests/mm/pkey-x86.h | 3 + tools/testing/selftests/mm/pkey_sighandler_tests.c | 10 ++--- tools/testing/selftests/mm/protection_keys.c | 18 +++++----- 7 files changed, 25 insertions(+), 23 deletions(-) --- a/tools/testing/selftests/mm/hugetlb_fault_after_madv.c~selftests-mm-mark-unused-arguments-with-__unused-2 +++ a/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 __unused *unused) { char *ptr = (char *)huge_ptr; @@ -41,7 +41,7 @@ void *touch(void *unused) return NULL; } -void *madv(void *unused) +void *madv(void __unused *unused) { usleep(rand() % 10); --- a/tools/testing/selftests/mm/hugetlb_madv_vs_map.c~selftests-mm-mark-unused-arguments-with-__unused-2 +++ a/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 __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 __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 __unused *unused) { void *ptr; --- a/tools/testing/selftests/mm/pkey-arm64.h~selftests-mm-mark-unused-arguments-with-__unused-2 +++ a/tools/testing/selftests/mm/pkey-arm64.h @@ -81,11 +81,12 @@ static inline int get_arch_reserved_keys return NR_RESERVED_PKEYS; } -static inline void expect_fault_on_read_execonly_key(void *p1, int pkey) +static inline void expect_fault_on_read_execonly_key(void __unused *p1, int __unused pkey) { } -static inline void *malloc_pkey_with_mprotect_subpage(long size, int prot, u16 pkey) +static inline void *malloc_pkey_with_mprotect_subpage(long __unused size, int __unused prot, + u16 __unused pkey) { return PTR_ERR_ENOTSUP; } --- a/tools/testing/selftests/mm/pkey-powerpc.h~selftests-mm-mark-unused-arguments-with-__unused-2 +++ a/tools/testing/selftests/mm/pkey-powerpc.h @@ -93,7 +93,7 @@ static inline int get_arch_reserved_keys return NR_RESERVED_PKEYS_64K_3KEYS; } -static inline void expect_fault_on_read_execonly_key(void *p1, int pkey) +static inline void expect_fault_on_read_execonly_key(void __unused *p1, int __unused pkey) { /* * powerpc does not allow userspace to change permissions of exec-only --- a/tools/testing/selftests/mm/pkey_sighandler_tests.c~selftests-mm-mark-unused-arguments-with-__unused-2 +++ a/tools/testing/selftests/mm/pkey_sighandler_tests.c @@ -110,7 +110,7 @@ static inline u64 pkey_reg_restrictive_d 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 __unused signo, siginfo_t *info, void __unused *ucontext) { pthread_mutex_lock(&mutex); @@ -122,7 +122,7 @@ static void sigsegv_handler(int signo, s 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 __unused signo, siginfo_t *info, void __unused *ucontext) { pthread_mutex_lock(&mutex); @@ -132,7 +132,7 @@ static void sigusr1_handler(int signo, s pthread_mutex_unlock(&mutex); } -static void sigusr2_handler(int signo, siginfo_t *info, void *ucontext) +static void sigusr2_handler(int __unused signo, siginfo_t __unused *info, void __unused *ucontext) { /* * pkru should be the init_pkru value which enabled MPK 0 so @@ -155,7 +155,7 @@ static void raise_sigusr2(void) */ } -static void *thread_segv_with_pkey0_disabled(void *ptr) +static void *thread_segv_with_pkey0_disabled(void __unused *ptr) { /* Disable MPK 0 (and all others too) */ __write_pkey_reg(pkey_reg_restrictive_default()); @@ -165,7 +165,7 @@ static void *thread_segv_with_pkey0_disa return NULL; } -static void *thread_segv_pkuerr_stack(void *ptr) +static void *thread_segv_pkuerr_stack(void __unused *ptr) { /* Disable MPK 0 (and all others too) */ __write_pkey_reg(pkey_reg_restrictive_default()); --- a/tools/testing/selftests/mm/pkey-x86.h~selftests-mm-mark-unused-arguments-with-__unused-2 +++ a/tools/testing/selftests/mm/pkey-x86.h @@ -157,7 +157,8 @@ static inline void expect_fault_on_read_ 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 __unused size, int __unused prot, + u16 __unused pkey) { return PTR_ERR_ENOTSUP; } --- a/tools/testing/selftests/mm/protection_keys.c~selftests-mm-mark-unused-arguments-with-__unused-2 +++ a/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 __unused signum, siginfo_t *si, void *vucontext) { ucontext_t *uctxt = vucontext; int trapno; @@ -889,7 +889,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 __unused pkey) { int i, err; int max_nr_pkey_allocs; @@ -1106,7 +1106,7 @@ static void test_pkey_syscalls_on_non_al } /* 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 __unused pkey) { int err; int bad_pkey = NR_PKEYS+99; @@ -1132,7 +1132,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 __unused *ptr, u16 __unused pkey) { int err; int allocated_pkeys[NR_PKEYS] = {0}; @@ -1238,7 +1238,7 @@ static void arch_force_pkey_reg_init(voi * 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 __unused *ptr, u16 __unused pkey) { int err; int allocated_pkeys[NR_PKEYS] = {0}; @@ -1397,7 +1397,7 @@ static void *get_pointer_to_instructions return p1; } -static void test_executing_on_unreadable_memory(int *ptr, u16 pkey) +static void test_executing_on_unreadable_memory(int __unused *ptr, u16 pkey) { void *p1; int scratch; @@ -1429,7 +1429,7 @@ static void test_executing_on_unreadable pkey_assert(!ret); } -static void test_implicit_mprotect_exec_only_memory(int *ptr, u16 pkey) +static void test_implicit_mprotect_exec_only_memory(int __unused *ptr, u16 __unused pkey) { void *p1; int scratch; @@ -1478,7 +1478,7 @@ static void test_implicit_mprotect_exec_ } #if defined(__i386__) || defined(__x86_64__) -static void test_ptrace_modifies_pkru(int *ptr, u16 pkey) +static void test_ptrace_modifies_pkru(int __unused *ptr, u16 __unused pkey) { u32 new_pkru; pid_t child; @@ -1601,7 +1601,7 @@ static void test_ptrace_modifies_pkru(in #endif #if defined(__aarch64__) -static void test_ptrace_modifies_pkru(int *ptr, u16 pkey) +static void test_ptrace_modifies_pkru(int __unused *ptr, u16 __unused pkey) { pid_t child; int status, ret; _ Patches currently in -mm which might be from usama.anjum@collabora.com are selftests-mm-add-wunreachable-code-and-fix-warnings.patch selftests-mm-protection_keys-fix-dead-code.patch selftests-kselftesth-add-__unused-macro.patch selftests-mm-add-wunused-family-of-flags.patch selftests-mm-remove-unused-parameters.patch selftests-mm-mark-unused-arguments-with-__unused.patch selftests-mm-mark-unused-arguments-with-__unused-2.patch selftests-mm-fix-unused-parameter-warnings-for-different-architectures.patch