From d58c7353fd0178d94693d8735fbf39b8b6615eab Mon Sep 17 00:00:00 2001 From: Amer Al Shanawany Date: Sat, 20 Apr 2024 22:23:46 +0200 Subject: selftests: mm: fix linker error for inline function add 'static' keyword to 'sys_mprotect()' to link properly, otherwise the test won't build. gcc (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0 /usr/bin/ld: /tmp/cc7yeABp.o: in function `test_seal_elf': seal_elf.c:(.text+0x7af): undefined reference to `sys_mprotect' /usr/bin/ld: seal_elf.c:(.text+0x82c): undefined reference to `sys_mprotect' /usr/bin/ld: seal_elf.c:(.text+0xa4e): undefined reference to `sys_mprotect' Link: https://lkml.kernel.org/r/20240420202346.546444-1-amer.shanawany@gmail.com Signed-off-by: Amer Al Shanawany Cc: Javier Carrasco Cc: Shuah Khan Cc: Jeff Xu Signed-off-by: Andrew Morton --- tools/testing/selftests/mm/seal_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/seal_elf.c b/tools/testing/selftests/mm/seal_elf.c index 7143dc4f1b10..f0cf96625e58 100644 --- a/tools/testing/selftests/mm/seal_elf.c +++ b/tools/testing/selftests/mm/seal_elf.c @@ -72,7 +72,7 @@ static void *sys_mmap(void *addr, unsigned long len, unsigned long prot, return sret; } -inline int sys_mprotect(void *ptr, size_t size, unsigned long prot) +static inline int sys_mprotect(void *ptr, size_t size, unsigned long prot) { int sret; -- cgit v1.2.3