diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
commit | 1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch) | |
tree | f5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /include/asm-ia64/atomic.h | |
parent | ac58c9059da8886b5e8cde012a80266b18ca146e (diff) | |
parent | 674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff) |
Merge branch 'linus'
Diffstat (limited to 'include/asm-ia64/atomic.h')
-rw-r--r-- | include/asm-ia64/atomic.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/asm-ia64/atomic.h b/include/asm-ia64/atomic.h index d3e0dfa99e1f..569ec7574baf 100644 --- a/include/asm-ia64/atomic.h +++ b/include/asm-ia64/atomic.h | |||
@@ -95,8 +95,14 @@ ia64_atomic64_sub (__s64 i, atomic64_t *v) | |||
95 | ({ \ | 95 | ({ \ |
96 | int c, old; \ | 96 | int c, old; \ |
97 | c = atomic_read(v); \ | 97 | c = atomic_read(v); \ |
98 | while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ | 98 | for (;;) { \ |
99 | if (unlikely(c == (u))) \ | ||
100 | break; \ | ||
101 | old = atomic_cmpxchg((v), c, c + (a)); \ | ||
102 | if (likely(old == c)) \ | ||
103 | break; \ | ||
99 | c = old; \ | 104 | c = old; \ |
105 | } \ | ||
100 | c != (u); \ | 106 | c != (u); \ |
101 | }) | 107 | }) |
102 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | 108 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) |