diff options
author | Gautham R Shenoy <ego@in.ibm.com> | 2007-01-11 02:15:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-11 21:18:20 -0500 |
commit | b282b6f8a8d1cf3e132ce3769d7d1cac81d9dd2d (patch) | |
tree | a5201d54c20d85273694fb79d312ed9e1434e86d | |
parent | 0d103e90f63c4b78f2101f8c0bd303fa049ce9a7 (diff) |
[PATCH] Change cpu_up and co from __devinit to __cpuinit
Compiling the kernel with CONFIG_HOTPLUG = y and CONFIG_HOTPLUG_CPU = n
with CONFIG_RELOCATABLE = y generates the following modpost warnings
WARNING: vmlinux - Section mismatch: reference to .init.data: from
.text between '_cpu_up' (at offset 0xc0141b7d) and 'cpu_up'
WARNING: vmlinux - Section mismatch: reference to .init.data: from
.text between '_cpu_up' (at offset 0xc0141b9c) and 'cpu_up'
WARNING: vmlinux - Section mismatch: reference to .init.text:__cpu_up
from .text between '_cpu_up' (at offset 0xc0141bd8) and 'cpu_up'
WARNING: vmlinux - Section mismatch: reference to .init.data: from
.text between '_cpu_up' (at offset 0xc0141c05) and 'cpu_up'
WARNING: vmlinux - Section mismatch: reference to .init.data: from
.text between '_cpu_up' (at offset 0xc0141c26) and 'cpu_up'
WARNING: vmlinux - Section mismatch: reference to .init.data: from
.text between '_cpu_up' (at offset 0xc0141c37) and 'cpu_up'
This is because cpu_up, _cpu_up and __cpu_up (in some architectures) are
defined as __devinit
AND
__cpu_up calls some __cpuinit functions.
Since __cpuinit would map to __init with this kind of a configuration,
we get a .text refering .init.data warning.
This patch solves the problem by converting all of __cpu_up, _cpu_up
and cpu_up from __devinit to __cpuinit. The approach is justified since
the callers of cpu_up are either dependent on CONFIG_HOTPLUG_CPU or
are of __init type.
Thus when CONFIG_HOTPLUG_CPU=y, all these cpu up functions would land up
in .text section, and when CONFIG_HOTPLUG_CPU=n, all these functions would
land up in .init section.
Tested on a i386 SMP machine running linux-2.6.20-rc3-mm1.
Signed-off-by: Gautham R Shenoy <ego@in.ibm.com>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/cris/arch-v32/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/m32r/kernel/smpboot.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/parisc/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/smp.c | 2 | ||||
-rw-r--r-- | kernel/cpu.c | 4 |
7 files changed, 8 insertions, 8 deletions
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c index 2d0023f2d49b..77e655f26560 100644 --- a/arch/cris/arch-v32/kernel/smp.c +++ b/arch/cris/arch-v32/kernel/smp.c | |||
@@ -195,7 +195,7 @@ int setup_profiling_timer(unsigned int multiplier) | |||
195 | */ | 195 | */ |
196 | unsigned long cache_decay_ticks = 1; | 196 | unsigned long cache_decay_ticks = 1; |
197 | 197 | ||
198 | int __devinit __cpu_up(unsigned int cpu) | 198 | int __cpuinit __cpu_up(unsigned int cpu) |
199 | { | 199 | { |
200 | smp_boot_one_cpu(cpu); | 200 | smp_boot_one_cpu(cpu); |
201 | return cpu_online(cpu) ? 0 : -ENOSYS; | 201 | return cpu_online(cpu) ? 0 : -ENOSYS; |
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c index fa7865609495..48d376f47e1a 100644 --- a/arch/m32r/kernel/smpboot.c +++ b/arch/m32r/kernel/smpboot.c | |||
@@ -351,7 +351,7 @@ static void __init do_boot_cpu(int phys_id) | |||
351 | } | 351 | } |
352 | } | 352 | } |
353 | 353 | ||
354 | int __devinit __cpu_up(unsigned int cpu_id) | 354 | int __cpuinit __cpu_up(unsigned int cpu_id) |
355 | { | 355 | { |
356 | int timeout; | 356 | int timeout; |
357 | 357 | ||
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index f2a8701e414d..0555fc554f65 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -271,7 +271,7 @@ void __devinit smp_prepare_boot_cpu(void) | |||
271 | * and keep control until "cpu_online(cpu)" is set. Note: cpu is | 271 | * and keep control until "cpu_online(cpu)" is set. Note: cpu is |
272 | * physical, not logical. | 272 | * physical, not logical. |
273 | */ | 273 | */ |
274 | int __devinit __cpu_up(unsigned int cpu) | 274 | int __cpuinit __cpu_up(unsigned int cpu) |
275 | { | 275 | { |
276 | struct task_struct *idle; | 276 | struct task_struct *idle; |
277 | 277 | ||
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 4a23a97b06cd..12cc019307ad 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c | |||
@@ -608,7 +608,7 @@ void smp_cpus_done(unsigned int cpu_max) | |||
608 | } | 608 | } |
609 | 609 | ||
610 | 610 | ||
611 | int __devinit __cpu_up(unsigned int cpu) | 611 | int __cpuinit __cpu_up(unsigned int cpu) |
612 | { | 612 | { |
613 | if (cpu != 0 && cpu < parisc_max_cpus) | 613 | if (cpu != 0 && cpu < parisc_max_cpus) |
614 | smp_boot_one_cpu(cpu); | 614 | smp_boot_one_cpu(cpu); |
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 9b28c238b6c0..0e8beca460af 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -468,7 +468,7 @@ static int __devinit cpu_enable(unsigned int cpu) | |||
468 | return -ENOSYS; | 468 | return -ENOSYS; |
469 | } | 469 | } |
470 | 470 | ||
471 | int __devinit __cpu_up(unsigned int cpu) | 471 | int __cpuinit __cpu_up(unsigned int cpu) |
472 | { | 472 | { |
473 | int c; | 473 | int c; |
474 | 474 | ||
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 0a4958536bcd..fc99f7b8012f 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
@@ -1388,7 +1388,7 @@ void __devinit smp_prepare_boot_cpu(void) | |||
1388 | { | 1388 | { |
1389 | } | 1389 | } |
1390 | 1390 | ||
1391 | int __devinit __cpu_up(unsigned int cpu) | 1391 | int __cpuinit __cpu_up(unsigned int cpu) |
1392 | { | 1392 | { |
1393 | int ret = smp_boot_one_cpu(cpu); | 1393 | int ret = smp_boot_one_cpu(cpu); |
1394 | 1394 | ||
diff --git a/kernel/cpu.c b/kernel/cpu.c index 241064a32241..7406fe6966f9 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
@@ -204,7 +204,7 @@ int cpu_down(unsigned int cpu) | |||
204 | #endif /*CONFIG_HOTPLUG_CPU*/ | 204 | #endif /*CONFIG_HOTPLUG_CPU*/ |
205 | 205 | ||
206 | /* Requires cpu_add_remove_lock to be held */ | 206 | /* Requires cpu_add_remove_lock to be held */ |
207 | static int __devinit _cpu_up(unsigned int cpu) | 207 | static int __cpuinit _cpu_up(unsigned int cpu) |
208 | { | 208 | { |
209 | int ret; | 209 | int ret; |
210 | void *hcpu = (void *)(long)cpu; | 210 | void *hcpu = (void *)(long)cpu; |
@@ -239,7 +239,7 @@ out_notify: | |||
239 | return ret; | 239 | return ret; |
240 | } | 240 | } |
241 | 241 | ||
242 | int __devinit cpu_up(unsigned int cpu) | 242 | int __cpuinit cpu_up(unsigned int cpu) |
243 | { | 243 | { |
244 | int err = 0; | 244 | int err = 0; |
245 | 245 | ||