diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2011-08-24 01:59:58 +0200 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2011-08-29 22:44:12 +0200 |
commit | 8b8bc2f7311c3223213dbe346d9cc2e299fdb5eb (patch) | |
tree | 50a2f0faa3762084336be4f97c03a97b14b22262 /arch/x86/include/asm/rwsem.h | |
parent | x86: Add xadd helper macro (diff) | |
download | linux-8b8bc2f7311c3223213dbe346d9cc2e299fdb5eb.tar.xz linux-8b8bc2f7311c3223213dbe346d9cc2e299fdb5eb.zip |
x86: Use xadd helper more widely
This covers the trivial cases from open-coded xadd to the xadd macros.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Link: http://lkml.kernel.org/r/4E5BCC40.3030501@goop.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/include/asm/rwsem.h')
-rw-r--r-- | arch/x86/include/asm/rwsem.h | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86/include/asm/rwsem.h index df4cd32b4cc6..2dbe4a721ce5 100644 --- a/arch/x86/include/asm/rwsem.h +++ b/arch/x86/include/asm/rwsem.h @@ -204,13 +204,7 @@ static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem) */ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem) { - long tmp = delta; - - asm volatile(LOCK_PREFIX "xadd %0,%1" - : "+r" (tmp), "+m" (sem->count) - : : "memory"); - - return tmp + delta; + return delta + xadd(&sem->count, delta); } #endif /* __KERNEL__ */ |