diff options
author | Pranith Kumar <bobby.prani@gmail.com> | 2014-09-23 10:29:50 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-10-03 00:06:23 -0400 |
commit | 2291059c852706c6f5ffb400366042b7625066cd (patch) | |
tree | 7827b5e7992bc0d3533d5832773c6be2f4221782 /arch/parisc/include/asm | |
parent | da4c54457e6d8262423aded4bcbccc4103049506 (diff) |
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/parisc/include/asm')
-rw-r--r-- | arch/parisc/include/asm/atomic.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h index 219750bb4ae7..226f8ca993f6 100644 --- a/arch/parisc/include/asm/atomic.h +++ b/arch/parisc/include/asm/atomic.h | |||
@@ -67,7 +67,7 @@ static __inline__ void atomic_set(atomic_t *v, int i) | |||
67 | 67 | ||
68 | static __inline__ int atomic_read(const atomic_t *v) | 68 | static __inline__ int atomic_read(const atomic_t *v) |
69 | { | 69 | { |
70 | return (*(volatile int *)&(v)->counter); | 70 | return ACCESS_ONCE((v)->counter); |
71 | } | 71 | } |
72 | 72 | ||
73 | /* exported interface */ | 73 | /* exported interface */ |
@@ -204,7 +204,7 @@ atomic64_set(atomic64_t *v, s64 i) | |||
204 | static __inline__ s64 | 204 | static __inline__ s64 |
205 | atomic64_read(const atomic64_t *v) | 205 | atomic64_read(const atomic64_t *v) |
206 | { | 206 | { |
207 | return (*(volatile long *)&(v)->counter); | 207 | return ACCESS_ONCE((v)->counter); |
208 | } | 208 | } |
209 | 209 | ||
210 | #define atomic64_inc(v) (atomic64_add( 1,(v))) | 210 | #define atomic64_inc(v) (atomic64_add( 1,(v))) |