aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2011-02-17 07:13:56 -0500
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2011-02-17 07:13:58 -0500
commit03e3b5a0f18c53560de1984fbbfca146d31da2a5 (patch)
treeefa9b199ef82067b8f030c6ffa062c061d4c732b /arch
parent5da24b7627ff821e154a3aaecd5d60e1d8e228a5 (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')
-rw-r--r--arch/s390/include/asm/atomic.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h
index 76daea117181..50cfb5ed601b 100644
--- a/arch/s390/include/asm/atomic.h
+++ b/arch/s390/include/asm/atomic.h
@@ -36,14 +36,12 @@
36 36
37static inline int atomic_read(const atomic_t *v) 37static 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
43static inline void atomic_set(atomic_t *v, int i) 42static 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
49static inline int atomic_add_return(int i, atomic_t *v) 47static 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
129static inline long long atomic64_read(const atomic64_t *v) 127static 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
135static inline void atomic64_set(atomic64_t *v, long long i) 132static 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
141static inline long long atomic64_add_return(long long i, atomic64_t *v) 137static inline long long atomic64_add_return(long long i, atomic64_t *v)