typesafe: Convert stop_machine

Straightforward conversion of stop_machine_run.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 include/linux/stop_machine.h |   13 ++++++++-----
 kernel/stop_machine.c        |    5 +++--
 2 files changed, 11 insertions(+), 7 deletions(-)

diff -r 4ca543e01026 include/linux/stop_machine.h
--- a/include/linux/stop_machine.h	Tue Jul 08 23:13:03 2008 +1000
+++ b/include/linux/stop_machine.h	Tue Jul 08 23:14:57 2008 +1000
@@ -6,9 +6,8 @@
    diables preeempt. */
 #include <linux/cpu.h>
 #include <linux/cpumask.h>
+#include <linux/compiler.h>
 #include <asm/system.h>
-
-#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
 
 /* Deprecated, but useful for transition. */
 #define ALL_CPUS CPU_MASK_ALL_PTR
@@ -26,7 +25,11 @@
  *
  * This can be thought of as a very heavy write lock, equivalent to
  * grabbing every spinlock in the kernel. */
-int stop_machine_run(int (*fn)(void *), void *data, const cpumask_t *cpus);
+#define stop_machine_run(fn, data, cpus)				\
+	stop_machine_run_notype(typesafe_cb(int, (fn), (data)), (data), (cpus))
+
+#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
+int stop_machine_run_notype(int (*fn)(void *), void *, const cpumask_t *cpus);
 
 /**
  * __stop_machine_run: freeze the machine on all CPUs and run this function
@@ -40,8 +43,8 @@ int __stop_machine_run(int (*fn)(void *)
 int __stop_machine_run(int (*fn)(void *), void *data, const cpumask_t *cpus);
 #else
 
-static inline int stop_machine_run(int (*fn)(void *), void *data,
-				   const cpumask_t *cpus)
+static inline int stop_machine_run_notype(int (*fn)(void *), void *data,
+					  const cpumask_t *cpus)
 {
 	int ret;
 	local_irq_disable();
diff -r 4ca543e01026 kernel/stop_machine.c
--- a/kernel/stop_machine.c	Tue Jul 08 23:13:03 2008 +1000
+++ b/kernel/stop_machine.c	Tue Jul 08 23:14:57 2008 +1000
@@ -175,7 +175,8 @@ kill_threads:
 	return err;
 }
 
-int stop_machine_run(int (*fn)(void *), void *data, const cpumask_t *cpus)
+int stop_machine_run_notype(int (*fn)(void *), void *data,
+			    const cpumask_t *cpus)
 {
 	int ret;
 
@@ -186,4 +187,4 @@ int stop_machine_run(int (*fn)(void *), 
 
 	return ret;
 }
-EXPORT_SYMBOL_GPL(stop_machine_run);
+EXPORT_SYMBOL_GPL(stop_machine_run_notype);
