aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-09-07 17:08:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-09-07 17:08:37 -0400
commitce7db282a3830f57f5b05ec48288c23a5c4d66d5 (patch)
tree8e191c4b2ffa1658d5c014da5cc6230fc58c1a59 /include
parentcd4d4fc4137502f88ee871fc015a934dc28535e3 (diff)
parent54157c44471f5e266508ac08d270f2bc5857e8bb (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: percpu: fix a mismatch between code and comment percpu: fix a memory leak in pcpu_extend_area_map() percpu: add __percpu notations to UP allocator percpu: handle __percpu notations in UP accessors
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/percpu.h15
-rw-r--r--include/linux/percpu.h2
2 files changed, 11 insertions, 6 deletions
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index b5043a9890d8..08923b684768 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -70,11 +70,16 @@ extern void setup_per_cpu_areas(void);
70 70
71#else /* ! SMP */ 71#else /* ! SMP */
72 72
73#define per_cpu(var, cpu) (*((void)(cpu), &(var))) 73#define VERIFY_PERCPU_PTR(__p) ({ \
74#define __get_cpu_var(var) (var) 74 __verify_pcpu_ptr((__p)); \
75#define __raw_get_cpu_var(var) (var) 75 (typeof(*(__p)) __kernel __force *)(__p); \
76#define this_cpu_ptr(ptr) per_cpu_ptr(ptr, 0) 76})
77#define __this_cpu_ptr(ptr) this_cpu_ptr(ptr) 77
78#define per_cpu(var, cpu) (*((void)(cpu), VERIFY_PERCPU_PTR(&(var))))
79#define __get_cpu_var(var) (*VERIFY_PERCPU_PTR(&(var)))
80#define __raw_get_cpu_var(var) (*VERIFY_PERCPU_PTR(&(var)))
81#define this_cpu_ptr(ptr) per_cpu_ptr(ptr, 0)
82#define __this_cpu_ptr(ptr) this_cpu_ptr(ptr)
78 83
79#endif /* SMP */ 84#endif /* SMP */
80 85
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index b8b9084527b1..49466b13c5c6 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -149,7 +149,7 @@ extern void __init percpu_init_late(void);
149 149
150#else /* CONFIG_SMP */ 150#else /* CONFIG_SMP */
151 151
152#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) 152#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); VERIFY_PERCPU_PTR((ptr)); })
153 153
154/* can't distinguish from other static vars, always false */ 154/* can't distinguish from other static vars, always false */
155static inline bool is_kernel_percpu_address(unsigned long addr) 155static inline bool is_kernel_percpu_address(unsigned long addr)