public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* asm-i386/mmzone.h oddness.
@ 2005-07-01 21:26 Dave Jones
  2005-07-01 23:30 ` [PATCH] Clean up numa defines in mmzone.h Dave Jones
  2005-07-01 23:31 ` [PATCH] Fix up non-NUMA breakage " Dave Jones
  0 siblings, 2 replies; 3+ messages in thread
From: Dave Jones @ 2005-07-01 21:26 UTC (permalink / raw)
  To: linux-kernel

I was wondering why the rawhide gcc (4.0.0 20050622 (Red Hat 4.0.0-13))
blew up whilst trying to compile -rc3 and newer, with this informative
error..

include/asm/mmzone.h:154: error: syntax error before numeric constant

So I dug around, and I've not yet tested my theory, but this
looks just.. wrong.

#if CONFIG_NUMA
extern struct pglist_data *node_data[];
#define NODE_DATA(nid)  (node_data[nid])

#ifdef CONFIG_NUMA

The first #if used to be a #ifdef CONFIG_DISCONTIGMEM,
which made a little more sense to me, but I don't fully
understand the recent changes yet.

Anyone have clues ?

		Dave

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

* [PATCH] Clean up numa defines in mmzone.h
  2005-07-01 21:26 asm-i386/mmzone.h oddness Dave Jones
@ 2005-07-01 23:30 ` Dave Jones
  2005-07-01 23:31 ` [PATCH] Fix up non-NUMA breakage " Dave Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Jones @ 2005-07-01 23:30 UTC (permalink / raw)
  To: linux-kernel

On Fri, Jul 01, 2005 at 05:26:07PM -0400, Dave Jones wrote:

 > this looks just.. wrong.
 > 
 > #if CONFIG_NUMA
 > extern struct pglist_data *node_data[];
 > #define NODE_DATA(nid)  (node_data[nid])
 > 
 > #ifdef CONFIG_NUMA

This patch cleans this stuff up. The compile failure I
saw is fixed in the followup patch.

Signed-off-by: Dave Jones <davej@redhat.com>

--- linux-2.6.12/include/asm-i386/mmzone.h~	2005-07-01 17:59:22.000000000 -0400
+++ linux-2.6.12/include/asm-i386/mmzone.h	2005-07-01 18:01:44.000000000 -0400
@@ -8,20 +8,15 @@
 
 #include <asm/smp.h>
 
-#if CONFIG_NUMA
+#ifdef CONFIG_NUMA
 extern struct pglist_data *node_data[];
 #define NODE_DATA(nid)	(node_data[nid])
 
-#ifdef CONFIG_NUMA
-	#ifdef CONFIG_X86_NUMAQ
-		#include <asm/numaq.h>
-	#else	/* summit or generic arch */
-		#include <asm/srat.h>
-	#endif
-#else /* !CONFIG_NUMA */
-	#define get_memcfg_numa get_memcfg_numa_flat
-	#define get_zholes_size(n) (0)
-#endif /* CONFIG_NUMA */
+#ifdef CONFIG_X86_NUMAQ
+	#include <asm/numaq.h>
+#else	/* summit or generic arch */
+	#include <asm/srat.h>
+#endif
 
 extern int get_memcfg_numa_flat(void );
 /*
@@ -42,6 +37,9 @@ static inline void get_memcfg_numa(void)
 	get_memcfg_numa_flat();
 }
 
+#else /* !CONFIG_NUMA */
+#define get_memcfg_numa get_memcfg_numa_flat
+#define get_zholes_size(n) (0)
 #endif /* CONFIG_NUMA */
 
 #ifdef CONFIG_DISCONTIGMEM

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

* [PATCH] Fix up non-NUMA breakage in mmzone.h
  2005-07-01 21:26 asm-i386/mmzone.h oddness Dave Jones
  2005-07-01 23:30 ` [PATCH] Clean up numa defines in mmzone.h Dave Jones
@ 2005-07-01 23:31 ` Dave Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Jones @ 2005-07-01 23:31 UTC (permalink / raw)
  To: linux-kernel

On Fri, Jul 01, 2005 at 05:26:07PM -0400, Dave Jones wrote:
 > I was wondering why the rawhide gcc (4.0.0 20050622 (Red Hat 4.0.0-13))
 > blew up whilst trying to compile -rc3 and newer, with this informative
 > error..
 > 
 > include/asm/mmzone.h:154: error: syntax error before numeric constant

If CONFIG_NUMA isn't set, we use the define in <linux/mmzone.h>
for early_pfn_to_nid (which defines it to 0).

Because of this, the prototype needs to move inside the CONFIG_NUMA
too, or anal gcc's get really confused.

Signed-off-by: Dave Jones <davej@redhat.com>

--- linux-2.6.12/include/asm-i386/mmzone.h~	2005-07-01 18:30:14.000000000 -0400
+++ linux-2.6.12/include/asm-i386/mmzone.h	2005-07-01 18:30:30.000000000 -0400
@@ -37,6 +37,8 @@ static inline void get_memcfg_numa(void)
 	get_memcfg_numa_flat();
 }
 
+extern int early_pfn_to_nid(unsigned long pfn);
+
 #else /* !CONFIG_NUMA */
 #define get_memcfg_numa get_memcfg_numa_flat
 #define get_zholes_size(n) (0)
@@ -149,6 +151,4 @@ static inline int pfn_valid(int pfn)
 
 #endif /* CONFIG_NEED_MULTIPLE_NODES */
 
-extern int early_pfn_to_nid(unsigned long pfn);
-
 #endif /* _ASM_MMZONE_H_ */

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

end of thread, other threads:[~2005-07-01 23:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-01 21:26 asm-i386/mmzone.h oddness Dave Jones
2005-07-01 23:30 ` [PATCH] Clean up numa defines in mmzone.h Dave Jones
2005-07-01 23:31 ` [PATCH] Fix up non-NUMA breakage " Dave Jones

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