[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C21DC33.6070404@cn.fujitsu.com>
Date:	Wed, 23 Jun 2010 18:04:35 +0800
From:	Lai Jiangshan <laijs@...fujitsu.com>
To:	Tejun Heo <tj@...nel.org>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...e.hu>,
	LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 1/2] percpu: add percpu_variable_ptr()
The percpu variable and allocated percpu data are compatible
witch each other, This patch adds a API, thus we can use
per_cpu_ptr() for defined/declared percpu variable.
Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>
---
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index ce2dc65..d5c8d7f 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -81,6 +81,12 @@
 #endif
 
 /*
+ * Ptr of the declared/defined per-CPU variable.
+ * It is totally compatible with the return from alloc_percpu().
+ */
+#define percpu_variable_ptr(name) (&(name))
+
+/*
  * Variant on the per-CPU variable declaration/definition theme used for
  * ordinary per-CPU variables.
  */
--
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
 
