[PATCH] alpha: fix "statement with no effect" warnings
authorRichard Henderson <rth@twiddle.net>
Thu, 28 Jul 2005 08:07:41 +0000 (01:07 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 28 Jul 2005 15:39:02 +0000 (08:39 -0700)
Apparently gcc 4.0 complains about "({ 0; });", which leads to -Werror
breakage in one of the alpha oprofile modules.

One might could argue that this is a gcc bug, in that statement-expressions
should be considered to be function-like rather than statement-like for the
purposes of this warning.  But it's just as easy to use an inline function
in the first place, side-stepping the issue.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/asm-alpha/smp.h
include/linux/smp.h

index 9950706..a3d09d1 100644 (file)
@@ -50,11 +50,16 @@ extern cpumask_t cpu_online_map;
 extern int smp_num_cpus;
 #define cpu_possible_map       cpu_present_mask
 
-int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, cpumask_t cpu);
+int smp_call_function_on_cpu(void (*) (void *), void *, int, int, cpumask_t);
 
 #else /* CONFIG_SMP */
 
-#define smp_call_function_on_cpu(func,info,retry,wait,cpu)    ({ 0; })
+static inline int
+smp_call_function_on_cpu (void (*func) (void *), void *info, int retry,
+                         int wait, cpumask_t cpu)
+{
+       return 0;
+}
 
 #endif /* CONFIG_SMP */
 
index 9dfa3ee..22b451d 100644 (file)
@@ -94,11 +94,23 @@ void smp_prepare_boot_cpu(void);
  */
 #define raw_smp_processor_id()                 0
 #define hard_smp_processor_id()                        0
-#define smp_call_function(func,info,retry,wait)        ({ 0; })
-#define on_each_cpu(func,info,retry,wait)      ({ func(info); 0; })
-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(void (*func) (void *), void *info,
+                                   int retry, int wait)
+{
+       return 0;
+}
+
+static inline int on_each_cpu(void (*func) (void *), void *info,
+                             int retry, int wait)
+{
+       func(info);
+       return 0;
+}
+
+static inline void smp_send_reschedule(int cpu) { }
+static inline void smp_prepare_boot_cpu(void) { }
 
 #endif /* !SMP */