Skip to content

Commit

Permalink
x86/alternative: Add a __alt_reloc_selftest() prototype
Browse files Browse the repository at this point in the history
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: 270a69c ("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
  • Loading branch information
Arnd Bergmann authored and Borislav Petkov (AMD) committed Aug 3, 2023
1 parent 6d33531 commit 1a3e4b4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kernel/alternative.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1a3e4b4

Please sign in to comment.