cpumask: x86: Introduce cpumask_of_node to replace node_to_cpumask()

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 arch/x86/include/asm/topology.h |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff -r 5177b75ff834 arch/x86/include/asm/topology.h
--- a/arch/x86/include/asm/topology.h	Fri Nov 07 23:17:29 2008 +1100
+++ b/arch/x86/include/asm/topology.h	Fri Nov 07 23:52:11 2008 +1100
@@ -61,11 +61,17 @@ static inline int cpu_to_node(int cpu)
  *
  * Side note: this function creates the returned cpumask on the stack
  * so with a high NR_CPUS count, excessive stack space is used.  The
- * node_to_cpumask_ptr function should be used whenever possible.
+ * cpumask_of_node function should be used whenever possible.
  */
 static inline cpumask_t node_to_cpumask(int node)
 {
 	return node_to_cpumask_map[node];
+}
+
+/* Returns a bitmask of CPUs on Node 'node'. */
+static inline const struct cpumask *cpumask_of_node(int node)
+{
+	return &node_to_cpumask_map[node];
 }
 
 #else /* CONFIG_X86_64 */
@@ -113,6 +119,9 @@ static inline cpumask_t node_to_cpumask(
 {
 	return node_to_cpumask_map[node];
 }
+
+/* Returns a bitmask of CPUs on Node 'node'. */
+#define cpumask_of_node(node)		_node_to_cpumask_ptr(node)
 
 #endif /* !CONFIG_DEBUG_PER_CPU_MAPS */
 
@@ -213,8 +222,7 @@ static inline int node_to_first_cpu(int 
 /* Returns the number of the first CPU on Node 'node'. */
 static inline int node_to_first_cpu(int node)
 {
-	node_to_cpumask_ptr(mask, node);
-	return first_cpu(*mask);
+	return cpumask_first(cpumask_of_node(node));
 }
 #endif
 
