From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Tejun Heo <tj@kernel.org>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] percpu: add percpu_variable_ptr()
Date: Wed, 23 Jun 2010 18:20:13 +0800 [thread overview]
Message-ID: <4C21DFDD.9030107@cn.fujitsu.com> (raw)
In-Reply-To: <4C21DCFF.5050604@kernel.org>
Tejun Heo wrote:
> On 06/23/2010 12:04 PM, Lai Jiangshan wrote:
>> 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))
>
> Why not just use &name?
>
I remember the real variable name is hidden.
We can't expose the inner details of percpu, so I add a macro for it.
Thanks,
Lai
next prev parent reply other threads:[~2010-06-23 10:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-23 10:04 [PATCH 1/2] percpu: add percpu_variable_ptr() Lai Jiangshan
2010-06-23 10:07 ` Tejun Heo
2010-06-23 10:20 ` Lai Jiangshan [this message]
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=4C21DFDD.9030107@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