Skip to content

Commit

Permalink
cpumask: statement expressions confuse some versions of gcc
Browse files Browse the repository at this point in the history
when you take the address of the result.  Noticed on a sparc64 compile
using a version 3.4.5 cross compiler.

 kernel/time/tick-common.c: In function `tick_check_new_device':
 kernel/time/tick-common.c:210: error: invalid lvalue in unary `&'
 ...

Just make it a regular expression.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Stephen Rothwell authored and Linus Torvalds committed Jul 30, 2008
1 parent a4319d9 commit 3dd730f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/cpumask.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static inline const cpumask_t *get_cpu_mask(unsigned int cpu)
* gcc optimizes it out (it's a constant) and there's no huge stack
* variable created:
*/
#define cpumask_of_cpu(cpu) ({ *get_cpu_mask(cpu); })
#define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu))


#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS)
Expand Down

0 comments on commit 3dd730f

Please sign in to comment.