aboutsummaryrefslogtreecommitdiff
path: root/include/asm-ia64/atomic.h
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-03-24 12:29:39 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-24 12:29:39 -0500
commit4bbf7bc4c7bf1c80ec3c942fa5f1b6e6fa67dd99 (patch)
treec4ff89dc09abe69d58db1e14da22ecda9fdd3ce8 /include/asm-ia64/atomic.h
parent84ac69e8bf9f36eb0166817373336d14fa58f5cc (diff)
parentaec5c3c1a929d7d79a420e943285cf3ba26a7c0d (diff)
Merge branch 'upstream'
Conflicts: drivers/scsi/libata-core.c
Diffstat (limited to 'include/asm-ia64/atomic.h')
-rw-r--r--include/asm-ia64/atomic.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/asm-ia64/atomic.h b/include/asm-ia64/atomic.h
index d3e0dfa99e1..569ec7574ba 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)
({ \
int c, old; \
c = atomic_read(v); \
- while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
+ for (;;) { \
+ if (unlikely(c == (u))) \
+ break; \
+ old = atomic_cmpxchg((v), c, c + (a)); \
+ if (likely(old == c)) \
+ break; \
c = old; \
+ } \
c != (u); \
})
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)