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 | 64ef291f46d795917f32a0f5975e2b76f6fe206a (patch) | |
tree | c900fa524230a90f44676212a7dc0349a0cea394 /include | |
parent | 3f04ba859597412afbfb31f2fcbe289f2461f9a1 (diff) |
percpu: make alloc_percpu() handle array types
alloc_percpu() couldn't handle array types like "int [100]" due to the
way return type was casted. Fix it by using typeof() instead.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com>
Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/percpu.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 3d9ba92b104f..519d6876590f 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -164,8 +164,8 @@ static inline void *pcpu_lpage_remapped(void *kaddr) | |||
164 | 164 | ||
165 | #endif /* CONFIG_SMP */ | 165 | #endif /* CONFIG_SMP */ |
166 | 166 | ||
167 | #define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ | 167 | #define alloc_percpu(type) \ |
168 | __alignof__(type)) | 168 | (typeof(type) *)__alloc_percpu(sizeof(type), __alignof__(type)) |
169 | 169 | ||
170 | /* | 170 | /* |
171 | * Optional methods for optimized non-lvalue per-cpu variable access. | 171 | * Optional methods for optimized non-lvalue per-cpu variable access. |