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

hwmon: (coretemp) fix section mismatch warning

Fix following warning:
WARNING: vmlinux.o(.text+0xebfd04): Section mismatch in reference from the function coretemp_cpu_callback() to the function .cpuinit.text:coretemp_device_add()

coretemp_cpu_callback() are only used inside a
HOTPLUG_CPU block so annotate it __cpuinit.
The notifier referencing the function are annotated
__refdata to silence warning from the exit function.
The unregister function do not use the embedded pointer
but clears the variable so the annotation is OK.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>

authored by

Sam Ravnborg and committed by
Mark M. Hoffman
ba7c1927 6369a288

+2 -2
+2 -2
drivers/hwmon/coretemp.c
··· 356 356 mutex_unlock(&pdev_list_mutex); 357 357 } 358 358 359 - static int coretemp_cpu_callback(struct notifier_block *nfb, 359 + static int __cpuinit coretemp_cpu_callback(struct notifier_block *nfb, 360 360 unsigned long action, void *hcpu) 361 361 { 362 362 unsigned int cpu = (unsigned long) hcpu; ··· 373 373 return NOTIFY_OK; 374 374 } 375 375 376 - static struct notifier_block coretemp_cpu_notifier = { 376 + static struct notifier_block coretemp_cpu_notifier __refdata = { 377 377 .notifier_call = coretemp_cpu_callback, 378 378 }; 379 379 #endif /* !CONFIG_HOTPLUG_CPU */