From: Tejun Heo Date: Thu, 29 Oct 2009 13:34:12 +0000 (+0900) Subject: percpu: make alloc_percpu() handle array types X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=64ef291f46d795917f32a0f5975e2b76f6fe206a;p=linux-beck.git 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 Reviewed-by: Frederic Weisbecker Reviewed-by: Christoph Lameter --- 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) #endif /* CONFIG_SMP */ -#define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ - __alignof__(type)) +#define alloc_percpu(type) \ + (typeof(type) *)__alloc_percpu(sizeof(type), __alignof__(type)) /* * Optional methods for optimized non-lvalue per-cpu variable access.