Skip to content

Commit 929bbc1

Browse files
committed
selftests/mm: Fix unused function warning for aarch64_write_signal_pkey()
Since commit 49f5957 ("selftests/mm: Enable pkey_sighandler_tests on arm64"), pkey_sighandler_tests.c (which includes pkey-arm64.h via pkey-helpers.h) ends up compiled for arm64. Since it doesn't use aarch64_write_signal_pkey(), the compiler warns: In file included from pkey-helpers.h:106, from pkey_sighandler_tests.c:31: pkey-arm64.h:130:13: warning: ‘aarch64_write_signal_pkey’ defined but not used [-Wunused-function] 130 | static void aarch64_write_signal_pkey(ucontext_t *uctxt, u64 pkey) | ^~~~~~~~~~~~~~~~~~~~~~~~~ Make the aarch64_write_signal_pkey() a 'static inline void' function to avoid the compiler warning. Fixes: f5b5ea5 ("selftests: mm: make protection_keys test work on arm64") Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Joey Gouly <joey.gouly@arm.com> Cc: Kevin Brodsky <kevin.brodsky@arm.com> Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com> Link: https://lore.kernel.org/r/20241108110549.1185923-1-catalin.marinas@arm.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent db64dff commit 929bbc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/mm/pkey-arm64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static inline u64 get_pkey_bits(u64 reg, int pkey)
127127
return 0;
128128
}
129129

130-
static void aarch64_write_signal_pkey(ucontext_t *uctxt, u64 pkey)
130+
static inline void aarch64_write_signal_pkey(ucontext_t *uctxt, u64 pkey)
131131
{
132132
struct _aarch64_ctx *ctx = GET_UC_RESV_HEAD(uctxt);
133133
struct poe_context *poe_ctx =

0 commit comments

Comments
 (0)