conflicting per_cpu_init() defines on non-SMP

From: dann frazier <dannf_at_dannf.org>
Date: 2005-03-09 16:09:58
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?

diff -urN linux-2.6.11.orig/arch/ia64/mm/discontig.c linux-2.6.11/arch/ia64/mm/discontig.c
--- linux-2.6.11.orig/arch/ia64/mm/discontig.c	2005-03-02 00:38:25.000000000 -0700
+++ linux-2.6.11/arch/ia64/mm/discontig.c	2005-03-08 22:10:48.704466208 -0700
@@ -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
diff -urN linux-2.6.11.orig/include/asm-ia64/percpu.h linux-2.6.11/include/asm-ia64/percpu.h
--- linux-2.6.11.orig/include/asm-ia64/percpu.h	2005-03-02 00:38:17.000000000 -0700
+++ linux-2.6.11/include/asm-ia64/percpu.h	2005-03-08 22:09:23.689818812 -0700
@@ -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 */
 


-- 
dann frazier <dannf@dannf.org>

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Mar 9 00:10:39 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:36 EST