diff options
author | Pranith Kumar <bobby.prani@gmail.com> | 2016-08-24 16:44:23 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-09-13 19:09:43 +0200 |
commit | 705ac1ca539ba05ab52c3290ccb45f9e47aa7c5e (patch) | |
tree | b212d1ede52f645d82e358f0c6864c4f0f5b7f72 | |
parent | c2cd627ddb13f62557aaf66305edb03cc3d9612d (diff) |
atomics: Remove redundant barrier()'s
Remove the redundant barrier() after the fence as agreed in previous
discussion here:
https://lists.gnu.org/archive/html/qemu-devel/2016-04/msg00489.html
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Message-Id: <20160824204424.14041-3-bobby.prani@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | include/qemu/atomic.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 43b06458f1..8348eccadb 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -72,16 +72,16 @@ * Add one here, and similarly in smp_rmb() and smp_read_barrier_depends(). */ -#define smp_mb() ({ barrier(); __atomic_thread_fence(__ATOMIC_SEQ_CST); barrier(); }) -#define smp_wmb() ({ barrier(); __atomic_thread_fence(__ATOMIC_RELEASE); barrier(); }) -#define smp_rmb() ({ barrier(); __atomic_thread_fence(__ATOMIC_ACQUIRE); barrier(); }) +#define smp_mb() ({ barrier(); __atomic_thread_fence(__ATOMIC_SEQ_CST); }) +#define smp_wmb() ({ barrier(); __atomic_thread_fence(__ATOMIC_RELEASE); }) +#define smp_rmb() ({ barrier(); __atomic_thread_fence(__ATOMIC_ACQUIRE); }) /* Most compilers currently treat consume and acquire the same, but really * no processors except Alpha need a barrier here. Leave it in if * using Thread Sanitizer to avoid warnings, otherwise optimize it away. */ #if defined(__SANITIZE_THREAD__) -#define smp_read_barrier_depends() ({ barrier(); __atomic_thread_fence(__ATOMIC_CONSUME); barrier(); }) +#define smp_read_barrier_depends() ({ barrier(); __atomic_thread_fence(__ATOMIC_CONSUME); }) #elsif defined(__alpha__) #define smp_read_barrier_depends() asm volatile("mb":::"memory") #else |