Skip to contentSkip to conversation

use generic topology macros where possible

PATCH New Matthew Dobson 1 participant 1 message Nov 5, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 use generic topology macros where possible

Linus,
This patch modifies the ppc64 and alpha topology.h files to use the
generic (non-NUMA) macros in the non-NUMA cases for both architectures.
Currently, the non-NUMA macros are defined in 3 places (asm-generic,
asm-ppc64, and asm-alpha), making it more difficult to keep them all in-sync. It even cuts out a whopping *9* lines of code! ;)

This patch applies cleanly alongside the other topology fix I just posted.

Please apply...

[mcd@arrakis patches]$ diffstat use_generic_topo-2.5.46.patch

 asm-alpha/topology.h |   19 +++++++------------
 asm-ppc64/topology.h |    8 ++------
 2 files changed, 9 insertions(+), 18 deletions(-)

Cheers!

-Matt

include/asm-alpha/topology.h +7 -12
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.46-vanilla/include/asm-alpha/topology.h linux-2.5.46-generic_topo_fix/include/asm-alpha/topology.h
@@ -1,20 +1,15 @@
 #ifndef _ASM_ALPHA_TOPOLOGY_H
 #define _ASM_ALPHA_TOPOLOGY_H
 
-#ifdef CONFIG_NUMA
-#ifdef CONFIG_ALPHA_WILDFIRE
+#if defined(CONFIG_NUMA) && defined(CONFIG_ALPHA_WILDFIRE)
+
 /* With wildfire assume 4 CPUs per node */
 #define __cpu_to_node(cpu)		((cpu) >> 2)
-#endif /* CONFIG_ALPHA_WILDFIRE */
-#endif /* CONFIG_NUMA */
 
-#if !defined(CONFIG_NUMA) || !defined(CONFIG_ALPHA_WILDFIRE)
-#define __cpu_to_node(cpu)		(0)
-#define __memblk_to_node(memblk)	(0)
-#define __parent_node(nid)		(0)
-#define __node_to_first_cpu(node)	(0)
-#define __node_to_cpu_mask(node)	(cpu_online_map)
-#define __node_to_memblk(node)		(0)
-#endif /* !CONFIG_NUMA || !CONFIG_ALPHA_WILDFIRE */
+#else /* !CONFIG_NUMA || !CONFIG_ALPHA_WILDFIRE */
+
+#include <asm-generic/topology.h>
+
+#endif /* CONFIG_NUMA && CONFIG_ALPHA_WILDFIRE */
 
 #endif /* _ASM_ALPHA_TOPOLOGY_H */
include/asm-ppc64/topology.h +2 -6
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.46-vanilla/include/asm-ppc64/topology.h linux-2.5.46-generic_topo_fix/include/asm-ppc64/topology.h
@@ -48,12 +48,8 @@
 
 #else /* !CONFIG_NUMA */
 
-#define __cpu_to_node(cpu)		(0)
-#define __memblk_to_node(memblk)	(0)
-#define __parent_node(nid)		(0)
-#define __node_to_first_cpu(node)	(0)
-#define __node_to_cpu_mask(node)	(cpu_online_map)
-#define __node_to_memblk(node)		(0)
+/* If non-NUMA, grab the generic macros */
+#include <asm-generic/topology.h>
 
 #endif /* CONFIG_NUMA */