summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2011-02-17 13:13:56 +0100
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2011-02-17 13:13:58 +0100
commit03e3b5a0f18c53560de1984fbbfca146d31da2a5 (patch)
treeefa9b199ef82067b8f030c6ffa062c061d4c732b /arch
parent5da24b7627ff821e154a3aaecd5d60e1d8e228a5 (diff)
downloadop-kernel-dev-03e3b5a0f18c53560de1984fbbfca146d31da2a5.zip
op-kernel-dev-03e3b5a0f18c53560de1984fbbfca146d31da2a5.tar.gz
[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 76daea1..50cfb5e 100644
--- a/arch/s390/include/asm/atomic.h
+++ b/arch/s390/include/asm/atomic.h
@@ -36,14 +36,12 @@
static inline int atomic_read(const atomic_t *v)
{
- barrier();
- return v->counter;
+ return ACCESS_ONCE(v->counter);
}
static inline void atomic_set(atomic_t *v, int i)
{
v->counter = i;
- barrier();
}
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)
static inline long long atomic64_read(const atomic64_t *v)
{
- barrier();
- return v->counter;
+ return ACCESS_ONCE(v->counter);
}
static inline void atomic64_set(atomic64_t *v, long long i)
{
v->counter = i;
- barrier();
}
static inline long long atomic64_add_return(long long i, atomic64_t *v)
OpenPOWER on IntegriCloud