summaryrefslogtreecommitdiffstats
path: root/include/asm-generic/atomic.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-07-26 16:09:09 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 16:49:47 -0700
commit3eea44ea753923c6af90be808426ecddc482de61 (patch)
tree6396fde749790461d6e355a0bf4d3ec88b56831b /include/asm-generic/atomic.h
parentacac43e2fc4b14ecf1ff229eaa8d1e011d063749 (diff)
downloadblackbird-op-linux-3eea44ea753923c6af90be808426ecddc482de61.tar.gz
blackbird-op-linux-3eea44ea753923c6af90be808426ecddc482de61.zip
asm-generic/atomic.h: simplify inc/dec test helpers
We already declared inc/dec helpers, so we don't need to call the atomic_{add,sub}_return funcs directly. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Cc: Arun Sharma <asharma@fb.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic/atomic.h')
-rw-r--r--include/asm-generic/atomic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
index 90e23ea90d0d..2a23da03365e 100644
--- a/include/asm-generic/atomic.h
+++ b/include/asm-generic/atomic.h
@@ -119,8 +119,8 @@ static inline void atomic_dec(atomic_t *v)
#define atomic_inc_return(v) atomic_add_return(1, (v))
#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0)
-#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
-#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
+#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
+#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
#define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v)))
#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
OpenPOWER on IntegriCloud