aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/percpu-defs.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-10-29 09:34:15 -0400
committerTejun Heo <tj@kernel.org>2009-10-29 09:34:15 -0400
commitdd17c8f72993f9461e9c19250e3f155d6d99df22 (patch)
treec33eedf0cf2862e9feeb796e94d49a2ccdce0149 /include/linux/percpu-defs.h
parent390dfd95c5df1ab3921dd388d11b2aee332c3f2c (diff)
percpu: remove per_cpu__ prefix.
Now that the return from alloc_percpu is compatible with the address of per-cpu vars, it makes sense to hand around the address of per-cpu variables. To make this sane, we remove the per_cpu__ prefix we used created to stop people accidentally using these vars directly. Now we have sparse, we can use that (next patch). tj: * Updated to convert stuff which were missed by or added after the original patch. * Kill per_cpu_var() macro. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
Diffstat (limited to 'include/linux/percpu-defs.h')
-rw-r--r--include/linux/percpu-defs.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 5a5d6ce4bd55..ee99f6c2cdcd 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -2,12 +2,6 @@
2#define _LINUX_PERCPU_DEFS_H 2#define _LINUX_PERCPU_DEFS_H
3 3
4/* 4/*
5 * Determine the real variable name from the name visible in the
6 * kernel sources.
7 */
8#define per_cpu_var(var) per_cpu__##var
9
10/*
11 * Base implementations of per-CPU variable declarations and definitions, where 5 * Base implementations of per-CPU variable declarations and definitions, where
12 * the section in which the variable is to be placed is provided by the 6 * the section in which the variable is to be placed is provided by the
13 * 'sec' argument. This may be used to affect the parameters governing the 7 * 'sec' argument. This may be used to affect the parameters governing the
@@ -56,24 +50,24 @@
56 */ 50 */
57#define DECLARE_PER_CPU_SECTION(type, name, sec) \ 51#define DECLARE_PER_CPU_SECTION(type, name, sec) \
58 extern __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ 52 extern __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \
59 extern __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name 53 extern __PCPU_ATTRS(sec) __typeof__(type) name
60 54
61#define DEFINE_PER_CPU_SECTION(type, name, sec) \ 55#define DEFINE_PER_CPU_SECTION(type, name, sec) \
62 __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ 56 __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \
63 extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ 57 extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
64 __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ 58 __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
65 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ 59 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \
66 __typeof__(type) per_cpu__##name 60 __typeof__(type) name
67#else 61#else
68/* 62/*
69 * Normal declaration and definition macros. 63 * Normal declaration and definition macros.
70 */ 64 */
71#define DECLARE_PER_CPU_SECTION(type, name, sec) \ 65#define DECLARE_PER_CPU_SECTION(type, name, sec) \
72 extern __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name 66 extern __PCPU_ATTRS(sec) __typeof__(type) name
73 67
74#define DEFINE_PER_CPU_SECTION(type, name, sec) \ 68#define DEFINE_PER_CPU_SECTION(type, name, sec) \
75 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES \ 69 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES \
76 __typeof__(type) per_cpu__##name 70 __typeof__(type) name
77#endif 71#endif
78 72
79/* 73/*
@@ -137,8 +131,8 @@
137/* 131/*
138 * Intermodule exports for per-CPU variables. 132 * Intermodule exports for per-CPU variables.
139 */ 133 */
140#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) 134#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(var)
141#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) 135#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(var)
142 136
143 137
144#endif /* _LINUX_PERCPU_DEFS_H */ 138#endif /* _LINUX_PERCPU_DEFS_H */