diff options
author | Arun Sharma <asharma@fb.com> | 2011-07-26 19:09:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 19:49:47 -0400 |
commit | f24219b4e90cf70ec4a211b17fbabc725a0ddf3c (patch) | |
tree | c1c753bd425d61a5094995d9835b23b46383d9b2 /arch/parisc | |
parent | 60063497a95e716c9a689af3be2687d261f115b4 (diff) |
atomic: move atomic_add_unless to generic code
This is in preparation for more generic atomic primitives based on
__atomic_add_unless.
Signed-off-by: Arun Sharma <asharma@fb.com>
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/include/asm/atomic.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h index 192488999b63..1914f179879d 100644 --- a/arch/parisc/include/asm/atomic.h +++ b/arch/parisc/include/asm/atomic.h | |||
@@ -197,15 +197,15 @@ static __inline__ int atomic_read(const atomic_t *v) | |||
197 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | 197 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) |
198 | 198 | ||
199 | /** | 199 | /** |
200 | * atomic_add_unless - add unless the number is a given value | 200 | * __atomic_add_unless - add unless the number is a given value |
201 | * @v: pointer of type atomic_t | 201 | * @v: pointer of type atomic_t |
202 | * @a: the amount to add to v... | 202 | * @a: the amount to add to v... |
203 | * @u: ...unless v is equal to u. | 203 | * @u: ...unless v is equal to u. |
204 | * | 204 | * |
205 | * Atomically adds @a to @v, so long as it was not @u. | 205 | * Atomically adds @a to @v, so long as it was not @u. |
206 | * Returns non-zero if @v was not @u, and zero otherwise. | 206 | * Returns the old value of @v. |
207 | */ | 207 | */ |
208 | static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) | 208 | static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u) |
209 | { | 209 | { |
210 | int c, old; | 210 | int c, old; |
211 | c = atomic_read(v); | 211 | c = atomic_read(v); |
@@ -217,7 +217,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) | |||
217 | break; | 217 | break; |
218 | c = old; | 218 | c = old; |
219 | } | 219 | } |
220 | return c != (u); | 220 | return c; |
221 | } | 221 | } |
222 | 222 | ||
223 | 223 | ||
@@ -316,7 +316,7 @@ atomic64_read(const atomic64_t *v) | |||
316 | * @u: ...unless v is equal to u. | 316 | * @u: ...unless v is equal to u. |
317 | * | 317 | * |
318 | * Atomically adds @a to @v, so long as it was not @u. | 318 | * Atomically adds @a to @v, so long as it was not @u. |
319 | * Returns non-zero if @v was not @u, and zero otherwise. | 319 | * Returns the old value of @v. |
320 | */ | 320 | */ |
321 | static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) | 321 | static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) |
322 | { | 322 | { |