typesafe: 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 0eba07876617 include/linux/stop_machine.h
--- a/include/linux/stop_machine.h	Sat Jul 12 18:18:46 2008 +1000
+++ b/include/linux/stop_machine.h	Sat Jul 12 18:36:21 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 ~0U
@@ -26,8 +25,10 @@
  *
  * This can be thought of as a very heavy write lock, equivalent to
  * grabbing every spinlock in the kernel. */
-int stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus);
+#define stop_machine(fn, data, cpus)					\
+	stop_machine_notype(typesafe_cb(int, (fn), (data)), (data), (cpus))
 
+#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
 /**
  * __stop_machine: freeze the machine on all CPUs and run this function
  * @fn: the function to run
@@ -38,10 +39,12 @@ int stop_machine(int (*fn)(void *), void
  * won't come or go while it's being called.  Used by hotplug cpu.
  */
 int __stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus);
+
+int stop_machine_notype(int (*fn)(void *), void *data, const cpumask_t *cpus);
 #else
 
-static inline int stop_machine(int (*fn)(void *), void *data,
-			       const cpumask_t *cpus)
+static inline int stop_machine_notype(int (*fn)(void *), void *data,
+				      const cpumask_t *cpus)
 {
 	int ret;
 	local_irq_disable();
diff -r 0eba07876617 kernel/stop_machine.c
--- a/kernel/stop_machine.c	Sat Jul 12 18:18:46 2008 +1000
+++ b/kernel/stop_machine.c	Sat Jul 12 18:36:21 2008 +1000
@@ -175,7 +175,7 @@ kill_threads:
 	return err;
 }
 
-int stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus)
+int stop_machine_notype(int (*fn)(void *), void *data, const cpumask_t *cpus)
 {
 	int ret;
 
@@ -186,4 +186,4 @@ int stop_machine(int (*fn)(void *), void
 
 	return ret;
 }
-EXPORT_SYMBOL_GPL(stop_machine);
+EXPORT_SYMBOL_GPL(stop_machine_notype);
