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-sparc64/atomic.h | |
parent | ac58c9059da8886b5e8cde012a80266b18ca146e (diff) | |
parent | 674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff) |
Merge branch 'linus'
Diffstat (limited to 'include/asm-sparc64/atomic.h')
-rw-r--r-- | include/asm-sparc64/atomic.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/asm-sparc64/atomic.h b/include/asm-sparc64/atomic.h index 25256bdc8aae..468eb48d8142 100644 --- a/include/asm-sparc64/atomic.h +++ b/include/asm-sparc64/atomic.h | |||
@@ -78,9 +78,15 @@ extern int atomic64_sub_ret(int, atomic64_t *); | |||
78 | ({ \ | 78 | ({ \ |
79 | int c, old; \ | 79 | int c, old; \ |
80 | c = atomic_read(v); \ | 80 | c = atomic_read(v); \ |
81 | while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \ | 81 | for (;;) { \ |
82 | if (unlikely(c == (u))) \ | ||
83 | break; \ | ||
84 | old = atomic_cmpxchg((v), c, c + (a)); \ | ||
85 | if (likely(old == c)) \ | ||
86 | break; \ | ||
82 | c = old; \ | 87 | c = old; \ |
83 | c != (u); \ | 88 | } \ |
89 | likely(c != (u)); \ | ||
84 | }) | 90 | }) |
85 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | 91 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) |
86 | 92 | ||