Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba7c1927 authored by Sam Ravnborg's avatar Sam Ravnborg Committed by Mark M. Hoffman
Browse files

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: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarMark M. Hoffman <mhoffman@lightlink.com>
parent 6369a288
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -356,7 +356,7 @@ static void coretemp_device_remove(unsigned int cpu)
	mutex_unlock(&pdev_list_mutex);
}

static int coretemp_cpu_callback(struct notifier_block *nfb,
static int __cpuinit coretemp_cpu_callback(struct notifier_block *nfb,
				 unsigned long action, void *hcpu)
{
	unsigned int cpu = (unsigned long) hcpu;
@@ -373,7 +373,7 @@ static int coretemp_cpu_callback(struct notifier_block *nfb,
	return NOTIFY_OK;
}

static struct notifier_block coretemp_cpu_notifier = {
static struct notifier_block coretemp_cpu_notifier __refdata = {
	.notifier_call = coretemp_cpu_callback,
};
#endif				/* !CONFIG_HOTPLUG_CPU */