From: Mike Frysinger Date: Tue, 26 Jul 2011 23:09:09 +0000 (-0700) Subject: asm-generic/atomic.h: simplify inc/dec test helpers X-Git-Tag: v3.1-rc1~158 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3eea44ea753923c6af90be808426ecddc482de61;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Cc: Arun Sharma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h index 90e23ea..2a23da0 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)))