aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorArun Sharma <asharma@fb.com>2011-07-26 19:09:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 19:49:47 -0400
commitf24219b4e90cf70ec4a211b17fbabc725a0ddf3c (patch)
treec1c753bd425d61a5094995d9835b23b46383d9b2 /arch/blackfin
parent60063497a95e716c9a689af3be2687d261f115b4 (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/blackfin')
-rw-r--r--arch/blackfin/include/asm/atomic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/blackfin/include/asm/atomic.h b/arch/blackfin/include/asm/atomic.h
index f2cf5b714ea4..292c86f74f85 100644
--- a/arch/blackfin/include/asm/atomic.h
+++ b/arch/blackfin/include/asm/atomic.h
@@ -89,13 +89,13 @@ static inline void atomic_set_mask(int mask, atomic_t *v)
89#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) 89#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
90#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 90#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
91 91
92#define atomic_add_unless(v, a, u) \ 92#define __atomic_add_unless(v, a, u) \
93({ \ 93({ \
94 int c, old; \ 94 int c, old; \
95 c = atomic_read(v); \ 95 c = atomic_read(v); \
96 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ 96 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
97 c = old; \ 97 c = old; \
98 c != (u); \ 98 c; \
99}) 99})
100 100
101/* 101/*