Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] adjust per_cpu definition in non-SMP case

Fix (in the architectures I'm actually building for) the UP definition of
per_cpu so that the cpu specified may be any expression, not just an
identifier or a suffix expression.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Jan Beulich and committed by
Linus Torvalds
11c80c83 c7ea4b31

+3 -3
+1 -1
include/asm-generic/percpu.h
··· 29 29 #define DEFINE_PER_CPU(type, name) \ 30 30 __typeof__(type) per_cpu__##name 31 31 32 - #define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) 32 + #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 33 33 #define __get_cpu_var(var) per_cpu__##var 34 34 35 35 #endif /* SMP */
+1 -1
include/asm-ia64/percpu.h
··· 50 50 51 51 #else /* ! SMP */ 52 52 53 - #define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) 53 + #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 54 54 #define __get_cpu_var(var) per_cpu__##var 55 55 #define per_cpu_init() (__phys_per_cpu_start) 56 56
+1 -1
include/asm-x86_64/percpu.h
··· 39 39 #define DEFINE_PER_CPU(type, name) \ 40 40 __typeof__(type) per_cpu__##name 41 41 42 - #define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) 42 + #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) 43 43 #define __get_cpu_var(var) per_cpu__##var 44 44 45 45 #endif /* SMP */