public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Tejun Heo <tj@kernel.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] percpu: add percpu_variable_ptr()
Date: Wed, 23 Jun 2010 18:04:35 +0800	[thread overview]
Message-ID: <4C21DC33.6070404@cn.fujitsu.com> (raw)

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@cn.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.
  */

             reply	other threads:[~2010-06-23 10:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23 10:04 Lai Jiangshan [this message]
2010-06-23 10:07 ` [PATCH 1/2] percpu: add percpu_variable_ptr() Tejun Heo
2010-06-23 10:20   ` Lai Jiangshan
2010-06-23 10:22     ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C21DC33.6070404@cn.fujitsu.com \
    --to=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox