X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-sparc64%2Fatomic.h;h=25256bdc8aae3f9a64862f8b73cdf0dad0d7f840;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=468eb48d814246e0b793b900d459b0ad51422cd6;hpb=9464c7cf61b9433057924c36e6e02f303a00e768;p=linux-2.6.git diff --git a/include/asm-sparc64/atomic.h b/include/asm-sparc64/atomic.h index 468eb48d8..25256bdc8 100644 --- a/include/asm-sparc64/atomic.h +++ b/include/asm-sparc64/atomic.h @@ -78,15 +78,9 @@ extern int atomic64_sub_ret(int, atomic64_t *); ({ \ int c, old; \ c = atomic_read(v); \ - for (;;) { \ - if (unlikely(c == (u))) \ - break; \ - old = atomic_cmpxchg((v), c, c + (a)); \ - if (likely(old == c)) \ - break; \ + while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ c = old; \ - } \ - likely(c != (u)); \ + c != (u); \ }) #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)