x86/alternative: Add a __alt_reloc_selftest() prototype
authorArnd Bergmann <arnd@arndb.de>
Thu, 3 Aug 2023 08:26:17 +0000 (10:26 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Thu, 3 Aug 2023 14:40:50 +0000 (16:40 +0200)
The newly introduced selftest function causes a warning when -Wmissing-prototypes
is enabled:

  arch/x86/kernel/alternative.c:1461:32: error: no previous prototype for '__alt_reloc_selftest' [-Werror=missing-prototypes]

Since it's only used locally, add the prototype directly in front of it.

Fixes: 270a69c4485d ("x86/alternative: Support relocations in alternatives")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230803082619.1369127-6-arnd@kernel.org
arch/x86/kernel/alternative.c

index 2dcf3a0..934c23f 100644 (file)
@@ -1531,6 +1531,7 @@ static noinline void __init int3_selftest(void)
 
 static __initdata int __alt_reloc_selftest_addr;
 
+extern void __init __alt_reloc_selftest(void *arg);
 __visible noinline void __init __alt_reloc_selftest(void *arg)
 {
        WARN_ON(arg != &__alt_reloc_selftest_addr);