cpumask: make CONFIG_NR_CPUS always valid.
From: Rusty Russell <rusty@rustcorp.com.au>

Currently we have NR_CPUS, which is 1 on UP, and CONFIG_NR_CPUS on
SMP.  If we make CONFIG_NR_CPUS always valid (and always 1 on !SMP),
we can skip the middleman.

This also allows us to find and check all the remaining NR_CPUS users.

To avoid breaking every arch, we cheat and do this for the moment
in the header.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
---
 arch/x86/Kconfig        |    6 +++---
 include/linux/threads.h |   16 ++++++++--------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff -r 329e9ec99074 arch/x86/Kconfig
--- a/arch/x86/Kconfig	Thu Oct 23 23:46:33 2008 +1100
+++ b/arch/x86/Kconfig	Thu Oct 23 23:50:50 2008 +1100
@@ -580,12 +580,12 @@ config MAXSMP
 	  If unsure, say N.
 
 config NR_CPUS
-	depends on SMP
 	int "Maximum number of CPUs" if SMP && !MAXSMP
 	range 2 512 if SMP && !MAXSMP
+	default "1" if !SMP
 	default "4096" if MAXSMP
-	default "32" if X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000
-	default "8"
+	default "32" if SMP && (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000)
+	default "8" if SMP
 	help
 	  This allows you to specify the maximum number of CPUs which this
 	  kernel will support.  The maximum supported value is 512 and the
diff -r 329e9ec99074 include/linux/threads.h
--- a/include/linux/threads.h	Thu Oct 23 23:46:33 2008 +1100
+++ b/include/linux/threads.h	Thu Oct 23 23:50:50 2008 +1100
@@ -8,16 +8,16 @@
  */
 
 /*
- * Maximum supported processors that can run under SMP.  This value is
- * set via configure setting.  The maximum is equal to the size of the
- * bitmasks used on that platform, i.e. 32 or 64.  Setting this smaller
- * saves quite a bit of memory.
+ * Maximum supported processors.  Setting this smaller saves quite a
+ * bit of memory.  Use nr_cpu_ids instead of this except for static bitmaps.
  */
-#ifdef CONFIG_SMP
+#ifndef CONFIG_NR_CPUS
+/* FIXME: This should be fixed in the arch's Kconfig */
+#define CONFIG_NR_CPUS	1
+#endif
+
+/* Places which use this should consider cpumask_var_t. */
 #define NR_CPUS		CONFIG_NR_CPUS
-#else
-#define NR_CPUS		1
-#endif
 
 #define MIN_THREADS_LEFT_FOR_ROOT 4
 
