cpumask: CONFIG_DISABLE_CPUMASK_TYPEDEF

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             |    3 +++
 2 files changed, 13 insertions(+)

diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -141,8 +141,14 @@
 #include <linux/threads.h>
 #include <linux/bitmap.h>
 
+#ifndef CONFIG_DISABLE_CPUMASK_TYPEDEF
 typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
 extern cpumask_t _unused_cpumask_arg_;
+#else
+struct cpumask {
+	DECLARE_BITMAP(_bits, NR_CPUS);
+};
+#endif /* CONFIG_DISABLE_CPUMASK_TYPEDEF */
 
 #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
 #define cpu_set(cpu, dst) __cpu_set((cpu), &(dst))
@@ -515,7 +521,11 @@ extern const struct cpumask *const cpu_a
 
 /* These are the new versions of the cpumask operators: passed by pointer.
  * The older versions will be implemented in terms of these, then deleted. */
+#ifdef CONFIG_DISABLE_CPUMASK_TYPEDEF
+#define cpumask_bits(maskp) ((maskp)->_bits)
+#else
 #define cpumask_bits(maskp) ((maskp)->bits)
+#endif
 
 #if NR_CPUS <= BITS_PER_LONG
 #define CPU_BITS_ALL						\
diff --git a/lib/Kconfig b/lib/Kconfig
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -174,4 +174,7 @@ config DISABLE_OBSOLETE_CPUMASK_FUNCTION
        bool "Disable obsolete cpumask functions" if DEBUG_PER_CPU_MAPS
        depends on EXPERIMENTAL && BROKEN
 
+config DISABLE_CPUMASK_TYPEDEF
+       bool "Disable cpumask_t definition" if DEBUG_PER_CPU_MAPS
+
 endmenu
