lkml.org 
[lkml]   [2009]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] asm-generic: fix local_add_unless macro
* Roel Kluin (roel.kluin@gmail.com) wrote:
> ------------------------------>8-------------8<---------------------------------
> `local_add_unless(x, y, z)' will be expanded to `(&(x)->y, (y), (x))', but
> `&(x)->y' should be `&(x)->a'
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

It looks good to me.

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>

> ---
> Was this patch lost? it's still not in current git.
>
> diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h
> index dbd6150..fc21844 100644
> --- a/include/asm-generic/local.h
> +++ b/include/asm-generic/local.h
> @@ -42,7 +42,7 @@ typedef struct
>
> #define local_cmpxchg(l, o, n) atomic_long_cmpxchg((&(l)->a), (o), (n))
> #define local_xchg(l, n) atomic_long_xchg((&(l)->a), (n))
> -#define local_add_unless(l, a, u) atomic_long_add_unless((&(l)->a), (a), (u))
> +#define local_add_unless(l, _a, u) atomic_long_add_unless((&(l)->a), (_a), (u))
> #define local_inc_not_zero(l) atomic_long_inc_not_zero(&(l)->a)
>
> /* Non-atomic variants, ie. preemption disabled and won't be touched

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68


\
 
 \ /
  Last update: 2009-05-12 23:49    [W:0.389 / U:0.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site