diff options
-rw-r--r-- | arch/x86/include/asm/spinlock.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index d17c91981da2..4d3dcc51cacd 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h | |||
@@ -329,8 +329,7 @@ static inline int __raw_read_trylock(raw_rwlock_t *lock) | |||
329 | { | 329 | { |
330 | atomic_t *count = (atomic_t *)lock; | 330 | atomic_t *count = (atomic_t *)lock; |
331 | 331 | ||
332 | atomic_dec(count); | 332 | if (atomic_dec_return(count) >= 0) |
333 | if (atomic_read(count) >= 0) | ||
334 | return 1; | 333 | return 1; |
335 | atomic_inc(count); | 334 | atomic_inc(count); |
336 | return 0; | 335 | return 0; |