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/sparc/include/asm/atomic_64.h | |
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/sparc/include/asm/atomic_64.h')
-rw-r--r-- | arch/sparc/include/asm/atomic_64.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h index 337139ef91be..1fc3d0a62d66 100644 --- a/arch/sparc/include/asm/atomic_64.h +++ b/arch/sparc/include/asm/atomic_64.h | |||
@@ -70,7 +70,7 @@ extern long atomic64_sub_ret(long, atomic64_t *); | |||
70 | #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) | 70 | #define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n))) |
71 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | 71 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) |
72 | 72 | ||
73 | static inline int atomic_add_unless(atomic_t *v, int a, int u) | 73 | static inline int __atomic_add_unless(atomic_t *v, int a, int u) |
74 | { | 74 | { |
75 | int c, old; | 75 | int c, old; |
76 | c = atomic_read(v); | 76 | c = atomic_read(v); |
@@ -82,7 +82,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) | |||
82 | break; | 82 | break; |
83 | c = old; | 83 | c = old; |
84 | } | 84 | } |
85 | return c != (u); | 85 | return c; |
86 | } | 86 | } |
87 | 87 | ||
88 | 88 | ||