summaryrefslogtreecommitdiffstats
path: root/arch/alpha/include
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2010-05-17 14:33:53 +1000
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-17 07:57:27 -0700
commitf3d46f9d3194e0329216002a8724d4c0957abc79 (patch)
tree6d9413e4a448d7b8d342c40297c4fbe0b9c4c2f0 /arch/alpha/include
parente40152ee1e1c7a63f4777791863215e3faa37a86 (diff)
downloadblackbird-op-linux-f3d46f9d3194e0329216002a8724d4c0957abc79.tar.gz
blackbird-op-linux-f3d46f9d3194e0329216002a8724d4c0957abc79.zip
atomic_t: Cast to volatile when accessing atomic variables
In preparation for removing volatile from the atomic_t definition, this patch adds a volatile cast to all the atomic read functions. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/alpha/include')
-rw-r--r--arch/alpha/include/asm/atomic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/alpha/include/asm/atomic.h b/arch/alpha/include/asm/atomic.h
index 610dff44d94b..e756d04b6cd5 100644
--- a/arch/alpha/include/asm/atomic.h
+++ b/arch/alpha/include/asm/atomic.h
@@ -17,8 +17,8 @@
#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
#define ATOMIC64_INIT(i) ( (atomic64_t) { (i) } )
-#define atomic_read(v) ((v)->counter + 0)
-#define atomic64_read(v) ((v)->counter + 0)
+#define atomic_read(v) (*(volatile int *)&(v)->counter)
+#define atomic64_read(v) (*(volatile long *)&(v)->counter)
#define atomic_set(v,i) ((v)->counter = (i))
#define atomic64_set(v,i) ((v)->counter = (i))
OpenPOWER on IntegriCloud