]> Pileus Git - ~andy/linux/blobdiff - arch/powerpc/include/asm/topology.h
Merge branch 'x86-build-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[~andy/linux] / arch / powerpc / include / asm / topology.h
index 89e3ef2496ac72c4e03d17657833930de22f6b8e..d0b5fca6b0776fc8ef220483b91b1557c73a0835 100644 (file)
@@ -22,7 +22,15 @@ struct device_node;
 
 static inline int cpu_to_node(int cpu)
 {
-       return numa_cpu_lookup_table[cpu];
+       int nid;
+
+       nid = numa_cpu_lookup_table[cpu];
+
+       /*
+        * During early boot, the numa-cpu lookup table might not have been
+        * setup for all CPUs yet. In such cases, default to node 0.
+        */
+       return (nid < 0) ? 0 : nid;
 }
 
 #define parent_node(node)      (node)