Skip to content

Commit

Permalink
x86: avoid section mismatch involving arch_register_cpu
Browse files Browse the repository at this point in the history
Avoid section mismatch involving arch_register_cpu.

Marking arch_register_cpu as __init and removing the export
for non-hotplug-cpu configurations makes the following warning
go away:

Section mismatch in reference from the function
arch_register_cpu() to the function .devinit.text:register_cpu()
The function  arch_register_cpu() references
the function __devinit register_cpu().
This is often because arch_register_cpu lacks a __devinit
annotation or the annotation of register_cpu is wrong.

The only external user of arch_register_cpu in the tree is
in drivers/acpi/processor_core.c where it is guarded by
ACPI_HOTPLUG_CPU (which depends on HOTPLUG_CPU).

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
CC: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Alexander van Heukelum authored and Ingo Molnar committed Feb 1, 2008
1 parent 93809be commit d987402
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions arch/x86/kernel/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ void arch_unregister_cpu(int num)
}
EXPORT_SYMBOL(arch_unregister_cpu);
#else
int arch_register_cpu(int num)
static int __init arch_register_cpu(int num)
{
return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
}
EXPORT_SYMBOL(arch_register_cpu);
#endif /*CONFIG_HOTPLUG_CPU*/

static int __init topology_init(void)
Expand Down
3 changes: 2 additions & 1 deletion include/asm-x86/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
struct x86_cpu {
struct cpu cpu;
};
extern int arch_register_cpu(int num);

#ifdef CONFIG_HOTPLUG_CPU
extern int arch_register_cpu(int num);
extern void arch_unregister_cpu(int);
#endif

Expand Down

0 comments on commit d987402

Please sign in to comment.