Skip to content

Commit 6e62513

Browse files
nathanchancetsbogend
authored andcommitted
MIPS: Mark core_vpe_count() as __init
After commit 96cb8ae ("MIPS: Rework smt cmdline parameters"), modpost complains when building with clang: WARNING: modpost: vmlinux.o: section mismatch in reference: core_vpe_count (section: .text) -> smp_max_threads (section: .init.data) This warning occurs when core_vpe_count() is not inlined, as it appears that a non-init function is referring to an init symbol. However, this is not a problem in practice because core_vpe_count() is only called from __init functions, cps_smp_setup() and cps_prepare_cpus(). Resolve the warning by marking core_vpe_count() as __init, as it is only called in an init context so it can refer to init functions and symbols and have its memory freed on boot. Fixes: 96cb8ae ("MIPS: Rework smt cmdline parameters") Signed-off-by: Nathan Chancellor <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 13e6b81 commit 6e62513

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mips/kernel/smp-cps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static DECLARE_BITMAP(core_power, NR_CPUS);
2929

3030
struct core_boot_config *mips_cps_core_bootcfg;
3131

32-
static unsigned core_vpe_count(unsigned int cluster, unsigned core)
32+
static unsigned __init core_vpe_count(unsigned int cluster, unsigned core)
3333
{
3434
return min(smp_max_threads, mips_cps_numvps(cluster, core));
3535
}

0 commit comments

Comments
 (0)