diff options
Diffstat (limited to 'arch/x86/include/asm/atomic.h')
-rw-r--r-- | arch/x86/include/asm/atomic.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h index 952a826ac4e5..10572e309ab2 100644 --- a/arch/x86/include/asm/atomic.h +++ b/arch/x86/include/asm/atomic.h | |||
@@ -221,15 +221,15 @@ static inline int atomic_xchg(atomic_t *v, int new) | |||
221 | } | 221 | } |
222 | 222 | ||
223 | /** | 223 | /** |
224 | * atomic_add_unless - add unless the number is already a given value | 224 | * __atomic_add_unless - add unless the number is already a given value |
225 | * @v: pointer of type atomic_t | 225 | * @v: pointer of type atomic_t |
226 | * @a: the amount to add to v... | 226 | * @a: the amount to add to v... |
227 | * @u: ...unless v is equal to u. | 227 | * @u: ...unless v is equal to u. |
228 | * | 228 | * |
229 | * Atomically adds @a to @v, so long as @v was not already @u. | 229 | * Atomically adds @a to @v, so long as @v was not already @u. |
230 | * Returns non-zero if @v was not @u, and zero otherwise. | 230 | * Returns the old value of @v. |
231 | */ | 231 | */ |
232 | static inline int atomic_add_unless(atomic_t *v, int a, int u) | 232 | static inline int __atomic_add_unless(atomic_t *v, int a, int u) |
233 | { | 233 | { |
234 | int c, old; | 234 | int c, old; |
235 | c = atomic_read(v); | 235 | c = atomic_read(v); |
@@ -241,10 +241,9 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) | |||
241 | break; | 241 | break; |
242 | c = old; | 242 | c = old; |
243 | } | 243 | } |
244 | return c != (u); | 244 | return c; |
245 | } | 245 | } |
246 | 246 | ||
247 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | ||
248 | 247 | ||
249 | /* | 248 | /* |
250 | * atomic_dec_if_positive - decrement by 1 if old value positive | 249 | * atomic_dec_if_positive - decrement by 1 if old value positive |
@@ -319,5 +318,4 @@ static inline void atomic_or_long(unsigned long *v1, unsigned long v2) | |||
319 | # include "atomic64_64.h" | 318 | # include "atomic64_64.h" |
320 | #endif | 319 | #endif |
321 | 320 | ||
322 | #include <asm-generic/atomic-long.h> | ||
323 | #endif /* _ASM_X86_ATOMIC_H */ | 321 | #endif /* _ASM_X86_ATOMIC_H */ |