Skip to content

Commit 95b5baf

Browse files
nathanchancetsbogend
authored andcommitted
MIPS: Mark check_bugs() as __init
After commit ac7c3e4 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly"), a compiler may choose not to inline a function marked with just 'inline'. If check_bugs() is not inlined into start_kernel(), which occurs when building with clang after commit 9ea7e6b ("init: Mark [arch_call_]rest_init() __noreturn"), modpost complains with: WARNING: modpost: vmlinux.o: section mismatch in reference: check_bugs (section: .text) -> check_bugs32 (section: .init.text) check_bugs() is only called from start_kernel(), which itself is marked __init, so there would not be any issues at run time. Make it obvious to modpost that this call chain is safe by marking check_bugs() as __init, which fixes the warning. Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Link: https://lore.kernel.org/CA+G9fYt+4e57Gdy6cix=LeNK6XqWoui8du=mZWu=cf8vPYocKw@mail.gmail.com/ Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent 20470a6 commit 95b5baf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/mips/include/asm/bugs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static inline void check_bugs_early(void)
3030
check_bugs64_early();
3131
}
3232

33-
static inline void check_bugs(void)
33+
static inline void __init check_bugs(void)
3434
{
3535
unsigned int cpu = smp_processor_id();
3636

0 commit comments

Comments
 (0)