conflicting per_cpu_init() defines on non-SMP
In 2.6.11 arch/ia64/mm/discontig.c defines a per_cpu_init() function; however, non-SMP systems have a per_cpu_init macro defined in include/asm-ia64/percpu.h.
#define per_cpu_init() (__phys_per_cpu_start)
Is this the right way to approach a patch to fix this?
arch/ia64/mm/discontig.c +4 -0
@@ -525,6 +524,7 @@* find_pernode_space() does most of this already, we just need to set * local_per_cpu_offset */ +#ifdef CONFIG_SMP void *per_cpu_init (void ) {int cpu;
@@ -538,6 +538,9 @@ return __per_cpu_start + __per_cpu_offset[smp_processor_id()]; } +#else +#define per_cpu_init () (__phys_per_cpu_start) +#endif /** * show_mem - give short summary of memory stats
include/asm-ia64/percpu.h +0 -1
@@ -52,7 +52,6 @@#define per_cpu (var, cpu) (*((void)cpu, &per_cpu__##var))#define __get_cpu_var (var) per_cpu__##var -#define per_cpu_init () (__phys_per_cpu_start)#endif /* SMP */
Signature · 1 line
dann frazier <[email protected]>
Quoted 1 line · dann frazier
Is this the right way to approach a patch to fix this?
It looks right. But I'd expect arch/ia64/mm/discontig.c to use whats in the header file so everyone is using the same definition.
Quoted 2 lines
+#ifdef
CONFIG_SMP
void*per_cpu_init(void)
...
ie move that bit to asm-ia64/percpu.h
grant
Quoted 11 lines · Grant Grundler
Quoted 1 line · dann frazier
Is this the right way to approach a patch to fix this?
It looks right. But I'd expect
arch/ia64/mm/discontig.cto use whats in the header file so everyone is using the same definition.Quoted 2 lines
+#ifdef
CONFIG_SMP
void*per_cpu_init(void)...
ie move that bit to
asm-ia64/percpu.h
Thanks Grant.
I took a closer look at Jesse's fixes, and he had already solved this in a different way. I'll stick with his method.
Signature · 1 line
dann frazier <[email protected]>