[PATCH] Make smp_call_function{_single} go WARNING and return -EINVAL on !SMP The smp_call_function{_single} functions are used to run given function on all {or speicified} *other* CPUs. For UP systems, "other" CPUs simply don't exist, so we flag such incorrect usage of these functions using a WARNING. Also, -EBUSY is generally returned by arch implementations when they find that target_cpu == current_cpu, which is not a comparable case to the !SMP case. Use -EINVAL instead, similar to what powerpc does for !cpu_online(target), which is somewhat more analogous. Signed-off-by: Satyam Sharma Cc: Ingo Molnar Cc: Andi Kleen Cc: Alan Cox Cc: Heiko Carstens Cc: Andrew Morton Cc: David Miller --- include/linux/smp.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) --- diff -ruNp a/include/linux/smp.h b/include/linux/smp.h --- a/include/linux/smp.h 2007-06-07 12:46:50.000000000 +0530 +++ b/include/linux/smp.h 2007-06-07 22:02:34.000000000 +0530 @@ -6,6 +6,7 @@ * Alan Cox. */ +#include #include extern void cpu_idle(void); @@ -84,11 +85,6 @@ void smp_prepare_boot_cpu(void); * These macros fold the SMP functionality into a single CPU system */ #define raw_smp_processor_id() 0 -static inline int up_smp_call_function(void) -{ - return 0; -} -#define smp_call_function(func,info,retry,wait) (up_smp_call_function()) #define on_each_cpu(func,info,retry,wait) \ ({ \ local_irq_disable(); \ @@ -99,10 +95,17 @@ static inline int up_smp_call_function(v static inline void smp_send_reschedule(int cpu) { } #define num_booting_cpus() 1 #define smp_prepare_boot_cpu() do {} while (0) -static inline int smp_call_function_single(int cpuid, void (*func) (void *info), +static inline int smp_call_function(void (*func)(void *info), + void *info, int retry, int wait) +{ + WARN_ON(1); + return -EINVAL; +} +static inline int smp_call_function_single(int cpuid, void (*func)(void *info), void *info, int retry, int wait) { - return -EBUSY; + WARN_ON(1); + return -EINVAL; } #endif /* !SMP */