diff options
-rw-r--r-- | include/asm-i386/atomic.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h index 4dd272331361..08935113206a 100644 --- a/include/asm-i386/atomic.h +++ b/include/asm-i386/atomic.h | |||
@@ -207,8 +207,8 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v) | |||
207 | return atomic_add_return(-i,v); | 207 | return atomic_add_return(-i,v); |
208 | } | 208 | } |
209 | 209 | ||
210 | #define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) | 210 | #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) |
211 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | 211 | #define atomic_xchg(v, new) (xchg(&((v)->counter), (new))) |
212 | 212 | ||
213 | /** | 213 | /** |
214 | * atomic_add_unless - add unless the number is already a given value | 214 | * atomic_add_unless - add unless the number is already a given value |
@@ -221,7 +221,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v) | |||
221 | */ | 221 | */ |
222 | #define atomic_add_unless(v, a, u) \ | 222 | #define atomic_add_unless(v, a, u) \ |
223 | ({ \ | 223 | ({ \ |
224 | int c, old; \ | 224 | __typeof__((v)->counter) c, old; \ |
225 | c = atomic_read(v); \ | 225 | c = atomic_read(v); \ |
226 | for (;;) { \ | 226 | for (;;) { \ |
227 | if (unlikely(c == (u))) \ | 227 | if (unlikely(c == (u))) \ |