From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] asm-generic: fix local_add_unless macro
Date: Fri, 23 Jan 2009 10:45:20 -0500 [thread overview]
Message-ID: <20090123154520.GB7774@Krystal> (raw)
In-Reply-To: <49787DB4.8080308@gmail.com>
* Roel Kluin (roel.kluin@gmail.com) wrote:
> When this macro isn't called with 'a' this will
> result in a build failure.
>
Maybe we can add to the changelog, for prople like me who fail to see
the obvious :
"because local_add_unless(x, y, z) will be expanded to
(&(x)->y, (y), (x)), where (x)->y should be (x)->a.
Thanks,
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> 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
next prev parent reply other threads:[~2009-01-23 15:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-22 14:07 [PATCH] asm-generic: fix local_add_unless macro Roel Kluin
2009-01-22 18:05 ` Mathieu Desnoyers
2009-01-23 15:45 ` Mathieu Desnoyers [this message]
2009-05-12 21:31 ` Roel Kluin
2009-05-12 21:47 ` Mathieu Desnoyers
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=20090123154520.GB7774@Krystal \
--to=mathieu.desnoyers@polymtl.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=roel.kluin@gmail.com \
/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