diff options
author | Tejun Heo <tj@kernel.org> | 2009-10-29 09:34:12 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-10-29 09:34:12 -0400 |
commit | 0f5e4816dbf38ce9488e611ca2296925c1e90d5e (patch) | |
tree | 9c13079d21cb0c316db7e254222bca357ad7b41b /arch/x86/include/asm | |
parent | 64ef291f46d795917f32a0f5975e2b76f6fe206a (diff) |
percpu: remove some sparse warnings
Make the following changes to remove some sparse warnings.
* Make DEFINE_PER_CPU_SECTION() declare __pcpu_unique_* before
defining it.
* Annotate pcpu_extend_area_map() that it is entered with pcpu_lock
held, releases it and then reacquires it.
* Make percpu related macros use unique nested variable names.
* While at it, add pcpu prefix to __size_call[_return]() macros as
to-be-implemented sparse annotations will add percpu specific stuff
to these macros.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/percpu.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index 8b5ec19bdef4..0c44196b78ac 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h | |||
@@ -74,31 +74,31 @@ extern void __bad_percpu_size(void); | |||
74 | 74 | ||
75 | #define percpu_to_op(op, var, val) \ | 75 | #define percpu_to_op(op, var, val) \ |
76 | do { \ | 76 | do { \ |
77 | typedef typeof(var) T__; \ | 77 | typedef typeof(var) pto_T__; \ |
78 | if (0) { \ | 78 | if (0) { \ |
79 | T__ tmp__; \ | 79 | pto_T__ pto_tmp__; \ |
80 | tmp__ = (val); \ | 80 | pto_tmp__ = (val); \ |
81 | } \ | 81 | } \ |
82 | switch (sizeof(var)) { \ | 82 | switch (sizeof(var)) { \ |
83 | case 1: \ | 83 | case 1: \ |
84 | asm(op "b %1,"__percpu_arg(0) \ | 84 | asm(op "b %1,"__percpu_arg(0) \ |
85 | : "+m" (var) \ | 85 | : "+m" (var) \ |
86 | : "qi" ((T__)(val))); \ | 86 | : "qi" ((pto_T__)(val))); \ |
87 | break; \ | 87 | break; \ |
88 | case 2: \ | 88 | case 2: \ |
89 | asm(op "w %1,"__percpu_arg(0) \ | 89 | asm(op "w %1,"__percpu_arg(0) \ |
90 | : "+m" (var) \ | 90 | : "+m" (var) \ |
91 | : "ri" ((T__)(val))); \ | 91 | : "ri" ((pto_T__)(val))); \ |
92 | break; \ | 92 | break; \ |
93 | case 4: \ | 93 | case 4: \ |
94 | asm(op "l %1,"__percpu_arg(0) \ | 94 | asm(op "l %1,"__percpu_arg(0) \ |
95 | : "+m" (var) \ | 95 | : "+m" (var) \ |
96 | : "ri" ((T__)(val))); \ | 96 | : "ri" ((pto_T__)(val))); \ |
97 | break; \ | 97 | break; \ |
98 | case 8: \ | 98 | case 8: \ |
99 | asm(op "q %1,"__percpu_arg(0) \ | 99 | asm(op "q %1,"__percpu_arg(0) \ |
100 | : "+m" (var) \ | 100 | : "+m" (var) \ |
101 | : "re" ((T__)(val))); \ | 101 | : "re" ((pto_T__)(val))); \ |
102 | break; \ | 102 | break; \ |
103 | default: __bad_percpu_size(); \ | 103 | default: __bad_percpu_size(); \ |
104 | } \ | 104 | } \ |
@@ -106,31 +106,31 @@ do { \ | |||
106 | 106 | ||
107 | #define percpu_from_op(op, var, constraint) \ | 107 | #define percpu_from_op(op, var, constraint) \ |
108 | ({ \ | 108 | ({ \ |
109 | typeof(var) ret__; \ | 109 | typeof(var) pfo_ret__; \ |
110 | switch (sizeof(var)) { \ | 110 | switch (sizeof(var)) { \ |
111 | case 1: \ | 111 | case 1: \ |
112 | asm(op "b "__percpu_arg(1)",%0" \ | 112 | asm(op "b "__percpu_arg(1)",%0" \ |
113 | : "=q" (ret__) \ | 113 | : "=q" (pfo_ret__) \ |
114 | : constraint); \ | 114 | : constraint); \ |
115 | break; \ | 115 | break; \ |
116 | case 2: \ | 116 | case 2: \ |
117 | asm(op "w "__percpu_arg(1)",%0" \ | 117 | asm(op "w "__percpu_arg(1)",%0" \ |
118 | : "=r" (ret__) \ | 118 | : "=r" (pfo_ret__) \ |
119 | : constraint); \ | 119 | : constraint); \ |
120 | break; \ | 120 | break; \ |
121 | case 4: \ | 121 | case 4: \ |
122 | asm(op "l "__percpu_arg(1)",%0" \ | 122 | asm(op "l "__percpu_arg(1)",%0" \ |
123 | : "=r" (ret__) \ | 123 | : "=r" (pfo_ret__) \ |
124 | : constraint); \ | 124 | : constraint); \ |
125 | break; \ | 125 | break; \ |
126 | case 8: \ | 126 | case 8: \ |
127 | asm(op "q "__percpu_arg(1)",%0" \ | 127 | asm(op "q "__percpu_arg(1)",%0" \ |
128 | : "=r" (ret__) \ | 128 | : "=r" (pfo_ret__) \ |
129 | : constraint); \ | 129 | : constraint); \ |
130 | break; \ | 130 | break; \ |
131 | default: __bad_percpu_size(); \ | 131 | default: __bad_percpu_size(); \ |
132 | } \ | 132 | } \ |
133 | ret__; \ | 133 | pfo_ret__; \ |
134 | }) | 134 | }) |
135 | 135 | ||
136 | /* | 136 | /* |