Skip to content

Commit 2ac6608

Browse files
author
Linus Torvalds
committed
Revert broken "statement with no effect" warning fix
It may shut up gcc, but it also incorrectly changes the semantics of the smp_call_function() helpers. You can fix the warning other ways if you are interested (create another inline function that takes no arguments and returns zero), but preferably gcc just shouldn't complain about unused return values from statement expressions in the first place.
1 parent 7b70888 commit 2ac6608

2 files changed

Lines changed: 6 additions & 23 deletions

File tree

‎include/asm-alpha/smp.h‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,11 @@ 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 (*) (void *), void *, int, int, cpumask_t);
53+
int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, cpumask_t cpu);
5454

5555
#else /* CONFIG_SMP */
5656

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-
}
57+
#define smp_call_function_on_cpu(func,info,retry,wait,cpu) ({ 0; })
6358

6459
#endif /* CONFIG_SMP */
6560

‎include/linux/smp.h‎

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,11 @@ void smp_prepare_boot_cpu(void);
9494
*/
9595
#define raw_smp_processor_id() 0
9696
#define hard_smp_processor_id() 0
97-
#define num_booting_cpus() 1
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-
97+
#define smp_call_function(func,info,retry,wait) ({ 0; })
98+
#define on_each_cpu(func,info,retry,wait) ({ func(info); 0; })
11299
static inline void smp_send_reschedule(int cpu) { }
113-
static inline void smp_prepare_boot_cpu(void) { }
100+
#define num_booting_cpus() 1
101+
#define smp_prepare_boot_cpu() do {} while (0)
114102

115103
#endif /* !SMP */
116104

0 commit comments

Comments
 (0)