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        |    4 ++--
 2 files changed, 10 insertions(+), 7 deletions(-)

diff -r 84d9d3c7aa73 include/linux/stop_machine.h
--- a/include/linux/stop_machine.h	Tue May 06 10:53:34 2008 +1000
+++ b/include/linux/stop_machine.h	Tue May 06 10:54:24 2008 +1000
@@ -5,9 +5,8 @@
    (and more).  So the "read" side to such a lock is anything which
    diables preeempt. */
 #include <linux/cpu.h>
+#include <linux/compiler.h>
 #include <asm/system.h>
-
-#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
 
 #define ALL_CPUS ~0U
 
@@ -27,7 +26,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, unsigned int cpu);
+#define stop_machine_run(fn, data, cpu)					\
+	stop_machine_run_notype(typesafe_cb(int, (fn), (data)), (data), (cpu))
+
+#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
+int stop_machine_run_notype(int (*fn)(void *), void *data, unsigned int cpu);
 
 /**
  * __stop_machine_run: freeze the machine on all CPUs and run this function
@@ -44,8 +47,8 @@ struct task_struct *__stop_machine_run(i
 
 #else
 
-static inline int stop_machine_run(int (*fn)(void *), void *data,
-				   unsigned int cpu)
+static inline int stop_machine_run_notype(int (*fn)(void *), void *data,
+					  unsigned int cpu)
 {
 	int ret;
 	local_irq_disable();
diff -r 84d9d3c7aa73 kernel/stop_machine.c
--- a/kernel/stop_machine.c	Tue May 06 10:53:34 2008 +1000
+++ b/kernel/stop_machine.c	Tue May 06 10:54:24 2008 +1000
@@ -213,7 +213,7 @@ struct task_struct *__stop_machine_run(i
 	return p;
 }
 
-int stop_machine_run(int (*fn)(void *), void *data, unsigned int cpu)
+int stop_machine_run_notype(int (*fn)(void *), void *data, unsigned int cpu)
 {
 	struct task_struct *p;
 	int ret;
@@ -229,4 +229,4 @@ int stop_machine_run(int (*fn)(void *), 
 
 	return ret;
 }
-EXPORT_SYMBOL_GPL(stop_machine_run);
+EXPORT_SYMBOL_GPL(stop_machine_run_notype);
