aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/atomic.h
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2006-01-13 00:51:52 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-13 05:18:54 -0500
commitb11fa580ac06b34944a2b46a44ebce2c284e1a76 (patch)
tree128c569facfb43b1e3eccbb0ead907c52358a13e /include/asm-powerpc/atomic.h
parent144b9c135b963bcb7f242c7b83bff930620d3161 (diff)
[PATCH] powerpc: reformat atomic_add_unless
It makes my eyes hurt. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/atomic.h')
-rw-r--r--include/asm-powerpc/atomic.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h
index 9ce51ba54c13..147a38dcc766 100644
--- a/include/asm-powerpc/atomic.h
+++ b/include/asm-powerpc/atomic.h
@@ -176,19 +176,19 @@ static __inline__ int atomic_dec_return(atomic_t *v)
176 * Atomically adds @a to @v, so long as it was not @u. 176 * Atomically adds @a to @v, so long as it was not @u.
177 * Returns non-zero if @v was not @u, and zero otherwise. 177 * Returns non-zero if @v was not @u, and zero otherwise.
178 */ 178 */
179#define atomic_add_unless(v, a, u) \ 179#define atomic_add_unless(v, a, u) \
180({ \ 180({ \
181 int c, old; \ 181 int c, old; \
182 c = atomic_read(v); \ 182 c = atomic_read(v); \
183 for (;;) { \ 183 for (;;) { \
184 if (unlikely(c == (u))) \ 184 if (unlikely(c == (u))) \
185 break; \ 185 break; \
186 old = atomic_cmpxchg((v), c, c + (a)); \ 186 old = atomic_cmpxchg((v), c, c + (a)); \
187 if (likely(old == c)) \ 187 if (likely(old == c)) \
188 break; \ 188 break; \
189 c = old; \ 189 c = old; \
190 } \ 190 } \
191 c != (u); \ 191 c != (u); \
192}) 192})
193#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 193#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
194 194