public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* conflicting per_cpu_init() defines on non-SMP
@ 2005-03-09  5:09 dann frazier
  2005-03-09 17:38 ` Grant Grundler
  2005-03-13 22:16 ` dann frazier
  0 siblings, 2 replies; 3+ messages in thread
From: dann frazier @ 2005-03-09  5:09 UTC (permalink / raw)
  To: linux-ia64

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>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: conflicting per_cpu_init() defines on non-SMP
  2005-03-09  5:09 conflicting per_cpu_init() defines on non-SMP dann frazier
@ 2005-03-09 17:38 ` Grant Grundler
  2005-03-13 22:16 ` dann frazier
  1 sibling, 0 replies; 3+ messages in thread
From: Grant Grundler @ 2005-03-09 17:38 UTC (permalink / raw)
  To: linux-ia64

On Tue, Mar 08, 2005 at 10:09:58PM -0700, dann frazier wrote:
> 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.

> +#ifdef CONFIG_SMP
>  void *per_cpu_init(void)
...

ie move that bit to asm-ia64/percpu.h

grant

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: conflicting per_cpu_init() defines on non-SMP
  2005-03-09  5:09 conflicting per_cpu_init() defines on non-SMP dann frazier
  2005-03-09 17:38 ` Grant Grundler
@ 2005-03-13 22:16 ` dann frazier
  1 sibling, 0 replies; 3+ messages in thread
From: dann frazier @ 2005-03-13 22:16 UTC (permalink / raw)
  To: linux-ia64

On Wed, 2005-03-09 at 09:38 -0800, Grant Grundler wrote:
> On Tue, Mar 08, 2005 at 10:09:58PM -0700, dann frazier wrote:
> > 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.
> 
> > +#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.

-- 
dann frazier <dannf@dannf.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-13 22:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-09  5:09 conflicting per_cpu_init() defines on non-SMP dann frazier
2005-03-09 17:38 ` Grant Grundler
2005-03-13 22:16 ` dann frazier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox