atomic: move atomic_add_unless to generic code
[pandora-kernel.git] / arch / mn10300 / include / asm / atomic.h
index 041b9d6..a2e6759 100644 (file)
@@ -260,13 +260,13 @@ static inline void atomic_dec(atomic_t *v)
 #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_add_unless(v, a, u)                             \
+#define __atomic_add_unless(v, a, u)                           \
 ({                                                             \
        int c, old;                                             \
        c = atomic_read(v);                                     \
        while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
                c = old;                                        \
-       c != (u);                                               \
+       c;                                                      \
 })