提交 64ef291f 编写于 作者: T Tejun Heo

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: NTejun Heo <tj@kernel.org>
Reviewed-by: NFrederic Weisbecker <fweisbec@gmail.com>
Reviewed-by: NChristoph Lameter <cl@linux-foundation.org>
上级 3f04ba85
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册