diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-07-03 19:56:36 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-07-03 20:23:55 +0200 |
commit | 3a8d1788b37435baf6c296f4ea8beb4fa4955f44 (patch) | |
tree | 0db4ee093c0d9c8cb66321945fc024e5b1d3a8fd /arch/x86/include/asm | |
parent | 1fde902d52ee13ab9fab155bbae757fdf7daf0c1 (diff) | |
download | linux-3a8d1788b37435baf6c296f4ea8beb4fa4955f44.tar.gz linux-3a8d1788b37435baf6c296f4ea8beb4fa4955f44.tar.bz2 linux-3a8d1788b37435baf6c296f4ea8beb4fa4955f44.zip |
x86: atomic64: Improve atomic64_xchg()
Remove the read-first logic from atomic64_xchg() and simplify
the loop.
This function was the last user of __atomic64_read() - remove it.
Also, change the 'real_val' assumption from the somewhat quirky
1ULL << 32 value to the (just as arbitrary, but simpler) value
of 0.
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
LKML-Reference: <tip-05118ab8859492ac9ddda0154cf90e37b0a4a0b0@git.kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/atomic_32.h | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/arch/x86/include/asm/atomic_32.h b/arch/x86/include/asm/atomic_32.h index aa045deb2e75..d7c8849b8c67 100644 --- a/arch/x86/include/asm/atomic_32.h +++ b/arch/x86/include/asm/atomic_32.h @@ -268,15 +268,6 @@ typedef struct { #define ATOMIC64_INIT(val) { (val) } -/** - * atomic64_read - read atomic64 variable - * @ptr: pointer of type atomic64_t - * - * Atomically reads the value of @v. - * Doesn't imply a read memory barrier. - */ -#define __atomic64_read(ptr) ((ptr)->counter) - extern u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old_val, u64 new_val); /** |