summaryrefslogtreecommitdiffstats
path: root/arch/sparc/include/asm/atomic_64.h
diff options
context:
space:
mode:
authorPranith Kumar <bobby.prani@gmail.com>2014-09-23 10:29:50 -0400
committerIngo Molnar <mingo@kernel.org>2014-10-03 06:06:23 +0200
commit2291059c852706c6f5ffb400366042b7625066cd (patch)
tree7827b5e7992bc0d3533d5832773c6be2f4221782 /arch/sparc/include/asm/atomic_64.h
parentda4c54457e6d8262423aded4bcbccc4103049506 (diff)
downloadtalos-obmc-linux-2291059c852706c6f5ffb400366042b7625066cd.tar.gz
talos-obmc-linux-2291059c852706c6f5ffb400366042b7625066cd.zip
locking,arch: Use ACCESS_ONCE() instead of cast to volatile in atomic_read()
Use the much more reader friendly ACCESS_ONCE() instead of the cast to volatile. This is purely a stylistic change. Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no> Acked-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: linux-arch@vger.kernel.org Link: http://lkml.kernel.org/r/1411482607-20948-1-git-send-email-bobby.prani@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/sparc/include/asm/atomic_64.h')
-rw-r--r--arch/sparc/include/asm/atomic_64.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h
index 7e4ca1e73cd9..4082749913ce 100644
--- a/arch/sparc/include/asm/atomic_64.h
+++ b/arch/sparc/include/asm/atomic_64.h
@@ -14,8 +14,8 @@
#define ATOMIC_INIT(i) { (i) }
#define ATOMIC64_INIT(i) { (i) }
-#define atomic_read(v) (*(volatile int *)&(v)->counter)
-#define atomic64_read(v) (*(volatile long *)&(v)->counter)
+#define atomic_read(v) ACCESS_ONCE((v)->counter)
+#define atomic64_read(v) ACCESS_ONCE((v)->counter)
#define atomic_set(v, i) (((v)->counter) = i)
#define atomic64_set(v, i) (((v)->counter) = i)
OpenPOWER on IntegriCloud