summaryrefslogtreecommitdiffstats
path: root/arch/sparc/include/asm/atomic_64.h
diff options
context:
space:
mode:
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