Skip to content

Commit 79a8810

Browse files
rth7680Linus Torvalds
authored andcommitted
[PATCH] alpha: fix "statement with no effect" warnings
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>
1 parent 11be00c commit 79a8810

2 files changed

Lines changed: 23 additions & 6 deletions

File tree

‎include/asm-alpha/smp.h‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,16 @@ extern cpumask_t cpu_online_map;
5050
extern int smp_num_cpus;
5151
#define cpu_possible_map cpu_present_mask
5252

53-
int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, cpumask_t cpu);
53+
int smp_call_function_on_cpu(void (*) (void *), void *, int, int, cpumask_t);
5454

5555
#else /* CONFIG_SMP */
5656

57-
#define smp_call_function_on_cpu(func,info,retry,wait,cpu) ({ 0; })
57+
static inline int
58+
smp_call_function_on_cpu (void (*func) (void *), void *info, int retry,
59+
int wait, cpumask_t cpu)
60+
{
61+
return 0;
62+
}
5863

5964
#endif /* CONFIG_SMP */
6065

‎include/linux/smp.h‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,23 @@ void smp_prepare_boot_cpu(void);
9494
*/
9595
#define raw_smp_processor_id() 0
9696
#define hard_smp_processor_id() 0
97-
#define smp_call_function(func,info,retry,wait) ({ 0; })
98-
#define on_each_cpu(func,info,retry,wait) ({ func(info); 0; })
99-
static inline void smp_send_reschedule(int cpu) { }
10097
#define num_booting_cpus() 1
101-
#define smp_prepare_boot_cpu() do {} while (0)
98+
99+
static inline int smp_call_function(void (*func) (void *), void *info,
100+
int retry, int wait)
101+
{
102+
return 0;
103+
}
104+
105+
static inline int on_each_cpu(void (*func) (void *), void *info,
106+
int retry, int wait)
107+
{
108+
func(info);
109+
return 0;
110+
}
111+
112+
static inline void smp_send_reschedule(int cpu) { }
113+
static inline void smp_prepare_boot_cpu(void) { }
102114

103115
#endif /* !SMP */
104116

0 commit comments

Comments
 (0)