cpumask: CONFIG_DISABLE_CPUMASK_DEFINITION

This helps find unconverted code.  Note we also change the bitmap inside
the struct, to catch those using ->bits directly (instead of cpumask_bits()).

It currently breaks compile horribly, as expected.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 include/linux/cpumask.h |   10 ++++++++++
 lib/Kconfig             |    9 ++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -10,7 +10,13 @@
 #include <linux/threads.h>
 #include <linux/bitmap.h>
 
+#ifndef CONFIG_DISABLE_CPUMASK_TYPEDEF
 typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
+#else
+struct cpumask {
+	DECLARE_BITMAP(_bits, CONFIG_NR_CPUS);
+};
+#endif /* CONFIG_DISABLE_CPUMASK_TYPEDEF */
 
 /**
  * cpumask_bits - get the bits in a cpumask
@@ -19,7 +25,11 @@ typedef struct cpumask { DECLARE_BITMAP(
  * You should only assume nr_cpu_ids bits of this mask are valid.  This is
  * a macro so it's const-correct.
  */
+#ifdef CONFIG_DISABLE_CPUMASK_TYPEDEF
+#define cpumask_bits(maskp) ((maskp)->_bits)
+#else
 #define cpumask_bits(maskp) ((maskp)->bits)
+#endif
 
 #if NR_CPUS == 1
 #define nr_cpu_ids		1
diff --git a/lib/Kconfig b/lib/Kconfig
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -188,7 +188,14 @@ config DISABLE_OBSOLETE_CPUMASK_FUNCTION
        bool "Disable obsolete cpumask functions" if DEBUG_PER_CPU_MAPS
        depends on EXPERIMENTAL && X86
        help
-	 Only x86 has been cleaned of obsolescent cpumask functions.
+	 Only x86 has been cleaned of obsolescent cpumask functions, so
+	 this should compile cleanly there.
+
+config DISABLE_CPUMASK_TYPEDEF
+       bool "Disable cpumask_t definition" if DEBUG_PER_CPU_MAPS && X86
+       help
+	 Only x86 has been cleaned of obsolescent cpumask_t, so this should
+	 compile cleanly there.
 
 #
 # Netlink attribute parsing support is select'ed if needed
