Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

base: arch_topology: fix section mismatch build warnings

Commit 2ef7a2953c81 ("arm, arm64: factorize common cpu capacity default code")
introduced init_cpu_capacity_callback and init_cpu_capacity_notifier
which are referenced from initcall and are missing __init{,data}
annotations resulting the below section mismatch build warnings.

"WARNING: vmlinux.o(.text+0xbab790): Section mismatch in reference from
the function init_cpu_capacity_callback() to the variable .init.text:$x
The function init_cpu_capacity_callback() references the variable
__init $x. This is often because init_cpu_capacity_callback lacks a
__init annotation or the annotation of $x is wrong."

This patch fixes the above build warnings by adding the required annotations.

Fixes: 2ef7a2953c81 ("arm, arm64: factorize common cpu capacity default code")
Cc: Juri Lelli <juri.lelli@arm.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Sudeep Holla and committed by
Greg Kroah-Hartman
452562ab 6878e7de

+6 -6
+6 -6
drivers/base/arch_topology.c
··· 166 166 } 167 167 168 168 #ifdef CONFIG_CPU_FREQ 169 - static cpumask_var_t cpus_to_visit; 170 - static void parsing_done_workfn(struct work_struct *work); 171 - static DECLARE_WORK(parsing_done_work, parsing_done_workfn); 169 + static cpumask_var_t cpus_to_visit __initdata; 170 + static void __init parsing_done_workfn(struct work_struct *work); 171 + static __initdata DECLARE_WORK(parsing_done_work, parsing_done_workfn); 172 172 173 - static int 173 + static int __init 174 174 init_cpu_capacity_callback(struct notifier_block *nb, 175 175 unsigned long val, 176 176 void *data) ··· 206 206 return 0; 207 207 } 208 208 209 - static struct notifier_block init_cpu_capacity_notifier = { 209 + static struct notifier_block init_cpu_capacity_notifier __initdata = { 210 210 .notifier_call = init_cpu_capacity_callback, 211 211 }; 212 212 ··· 232 232 } 233 233 core_initcall(register_cpufreq_notifier); 234 234 235 - static void parsing_done_workfn(struct work_struct *work) 235 + static void __init parsing_done_workfn(struct work_struct *work) 236 236 { 237 237 cpufreq_unregister_notifier(&init_cpu_capacity_notifier, 238 238 CPUFREQ_POLICY_NOTIFIER);