diff options
author | Anton Blanchard <anton@samba.org> | 2010-05-17 14:33:53 +1000 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-17 07:57:27 -0700 |
commit | f3d46f9d3194e0329216002a8724d4c0957abc79 (patch) | |
tree | 6d9413e4a448d7b8d342c40297c4fbe0b9c4c2f0 /arch/m68k | |
parent | e40152ee1e1c7a63f4777791863215e3faa37a86 (diff) | |
download | linux-3.10-f3d46f9d3194e0329216002a8724d4c0957abc79.tar.gz linux-3.10-f3d46f9d3194e0329216002a8724d4c0957abc79.tar.bz2 linux-3.10-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/m68k')
-rw-r--r-- | arch/m68k/include/asm/atomic_mm.h | 2 | ||||
-rw-r--r-- | arch/m68k/include/asm/atomic_no.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/m68k/include/asm/atomic_mm.h b/arch/m68k/include/asm/atomic_mm.h index d9d2ed64743..6a223b3f7e7 100644 --- a/arch/m68k/include/asm/atomic_mm.h +++ b/arch/m68k/include/asm/atomic_mm.h @@ -15,7 +15,7 @@ #define ATOMIC_INIT(i) { (i) } -#define atomic_read(v) ((v)->counter) +#define atomic_read(v) (*(volatile int *)&(v)->counter) #define atomic_set(v, i) (((v)->counter) = i) static inline void atomic_add(int i, atomic_t *v) diff --git a/arch/m68k/include/asm/atomic_no.h b/arch/m68k/include/asm/atomic_no.h index 5674cb9449b..289310c63a8 100644 --- a/arch/m68k/include/asm/atomic_no.h +++ b/arch/m68k/include/asm/atomic_no.h @@ -15,7 +15,7 @@ #define ATOMIC_INIT(i) { (i) } -#define atomic_read(v) ((v)->counter) +#define atomic_read(v) (*(volatile int *)&(v)->counter) #define atomic_set(v, i) (((v)->counter) = i) static __inline__ void atomic_add(int i, atomic_t *v) |