diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2011-02-17 07:13:56 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2011-02-17 07:13:58 -0500 |
commit | 03e3b5a0f18c53560de1984fbbfca146d31da2a5 (patch) | |
tree | efa9b199ef82067b8f030c6ffa062c061d4c732b /arch/s390/include/asm/atomic.h | |
parent | 5da24b7627ff821e154a3aaecd5d60e1d8e228a5 (diff) |
[S390] atomic: use ACCESS_ONCE() for atomic_read()
Let's make atomic_read() and atomic_set() behave like on all/most other
architectures. Generated code is identical with gcc 4.5.2.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/atomic.h')
-rw-r--r-- | arch/s390/include/asm/atomic.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h index 76daea11718..50cfb5ed601 100644 --- a/arch/s390/include/asm/atomic.h +++ b/arch/s390/include/asm/atomic.h | |||
@@ -36,14 +36,12 @@ | |||
36 | 36 | ||
37 | static inline int atomic_read(const atomic_t *v) | 37 | static inline int atomic_read(const atomic_t *v) |
38 | { | 38 | { |
39 | barrier(); | 39 | return ACCESS_ONCE(v->counter); |
40 | return v->counter; | ||
41 | } | 40 | } |
42 | 41 | ||
43 | static inline void atomic_set(atomic_t *v, int i) | 42 | static inline void atomic_set(atomic_t *v, int i) |
44 | { | 43 | { |
45 | v->counter = i; | 44 | v->counter = i; |
46 | barrier(); | ||
47 | } | 45 | } |
48 | 46 | ||
49 | static inline int atomic_add_return(int i, atomic_t *v) | 47 | static inline int atomic_add_return(int i, atomic_t *v) |
@@ -128,14 +126,12 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) | |||
128 | 126 | ||
129 | static inline long long atomic64_read(const atomic64_t *v) | 127 | static inline long long atomic64_read(const atomic64_t *v) |
130 | { | 128 | { |
131 | barrier(); | 129 | return ACCESS_ONCE(v->counter); |
132 | return v->counter; | ||
133 | } | 130 | } |
134 | 131 | ||
135 | static inline void atomic64_set(atomic64_t *v, long long i) | 132 | static inline void atomic64_set(atomic64_t *v, long long i) |
136 | { | 133 | { |
137 | v->counter = i; | 134 | v->counter = i; |
138 | barrier(); | ||
139 | } | 135 | } |
140 | 136 | ||
141 | static inline long long atomic64_add_return(long long i, atomic64_t *v) | 137 | static inline long long atomic64_add_return(long long i, atomic64_t *v) |