MIPS: Sink body of check_bugs_early() into its only call site
authorNathan Chancellor <nathan@kernel.org>
Fri, 21 Apr 2023 16:11:27 +0000 (09:11 -0700)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Sat, 22 Apr 2023 21:29:00 +0000 (23:29 +0200)
If check_bugs_early() is not inlined, which a compiler is free to do
after commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING
forcibly"), modpost would warn that check_bugs_early(), a non-init
function, refers to check_bugs64_early(), which is marked __init. This
would not result in any run time issues, as check_bugs_early() is only
called from setup_arch(), which is marked __init.

To avoid this potential warning, just sink the body of
check_bugs_early() into its single call site in setup_arch().

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/include/asm/bugs.h
arch/mips/kernel/setup.c

index 047e14227c453bbc25a817c1bfa03d6d025e2b09..653f78f3a6852e443ff82f520e9dba477d51a696 100644 (file)
@@ -24,12 +24,6 @@ extern void check_bugs64_early(void);
 extern void check_bugs32(void);
 extern void check_bugs64(void);
 
-static inline void check_bugs_early(void)
-{
-       if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
-               check_bugs64_early();
-}
-
 static inline void __init check_bugs(void)
 {
        unsigned int cpu = smp_processor_id();
index f1c88f8a1dc512e7b7a837f8f1ac62048c69e573..febdc5564638e9b9bbb959791ecb75d6068b676c 100644 (file)
@@ -786,7 +786,8 @@ void __init setup_arch(char **cmdline_p)
        setup_early_printk();
 #endif
        cpu_report();
-       check_bugs_early();
+       if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64))
+               check_bugs64_early();
 
 #if defined(CONFIG_VT)
 #if defined(CONFIG_VGA_CONSOLE)