Commit b11fa580 authored by Anton Blanchard's avatar Anton Blanchard Committed by Paul Mackerras

[PATCH] powerpc: reformat atomic_add_unless

It makes my eyes hurt.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 144b9c13
...@@ -176,19 +176,19 @@ static __inline__ int atomic_dec_return(atomic_t *v) ...@@ -176,19 +176,19 @@ static __inline__ int atomic_dec_return(atomic_t *v)
* Atomically adds @a to @v, so long as it was not @u. * Atomically adds @a to @v, so long as it was not @u.
* Returns non-zero if @v was not @u, and zero otherwise. * Returns non-zero if @v was not @u, and zero otherwise.
*/ */
#define atomic_add_unless(v, a, u) \ #define atomic_add_unless(v, a, u) \
({ \ ({ \
int c, old; \ int c, old; \
c = atomic_read(v); \ c = atomic_read(v); \
for (;;) { \ for (;;) { \
if (unlikely(c == (u))) \ if (unlikely(c == (u))) \
break; \ break; \
old = atomic_cmpxchg((v), c, c + (a)); \ old = atomic_cmpxchg((v), c, c + (a)); \
if (likely(old == c)) \ if (likely(old == c)) \
break; \ break; \
c = old; \ c = old; \
} \ } \
c != (u); \ c != (u); \
}) })
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment