[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1255500125-3210-3-git-send-email-tj@kernel.org>
Date: Wed, 14 Oct 2009 15:01:51 +0900
From: Tejun Heo <tj@...nel.org>
To: linux-kernel@...r.kernel.org, rusty@...tcorp.com.au,
cl@...ux-foundation.org, mingo@...hat.com, tglx@...utronix.de,
akpm@...ux-foundation.org, rostedt@...dmis.org, hpa@...or.com,
cebbert@...hat.com
Cc: Tejun Heo <tj@...nel.org>
Subject: [PATCH 02/16] 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@...nel.org>
Reviewed-by: Frederic Weisbecker <fweisbec@...il.com>
Reviewed-by: Christoph Lameter <cl@...ux-foundation.org>
---
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 3d9ba92..519d687 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.
--
1.6.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists