lkml.org 
[lkml]   [2010]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] percpu: add percpu_variable_ptr()
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?

Thanks.

--
tejun


\
 
 \ /
  Last update: 2010-06-23 12:11    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site