Skip to content

Commit 3c91841

Browse files
committed
asm/rwonce: Remove smp_read_barrier_depends() invocation
Alpha overrides __READ_ONCE() directly, so there's no need to use smp_read_barrier_depends() in the core code. This also means that __READ_ONCE() can be relied upon to provide dependency ordering. Acked-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Paul E. McKenney <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent d646285 commit 3c91841

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

include/asm-generic/rwonce.h

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,16 @@
4040

4141
/*
4242
* Use __READ_ONCE() instead of READ_ONCE() if you do not require any
43-
* atomicity or dependency ordering guarantees. Note that this may result
44-
* in tears!
43+
* atomicity. Note that this may result in tears!
4544
*/
4645
#ifndef __READ_ONCE
4746
#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
4847
#endif
4948

50-
#define __READ_ONCE_SCALAR(x) \
51-
({ \
52-
__unqual_scalar_typeof(x) __x = __READ_ONCE(x); \
53-
smp_read_barrier_depends(); \
54-
(typeof(x))__x; \
55-
})
56-
5749
#define READ_ONCE(x) \
5850
({ \
5951
compiletime_assert_rwonce_type(x); \
60-
__READ_ONCE_SCALAR(x); \
52+
__READ_ONCE(x); \
6153
})
6254

6355
#define __WRITE_ONCE(x, val) \
@@ -84,12 +76,9 @@ unsigned long __read_once_word_nocheck(const void *addr)
8476
*/
8577
#define READ_ONCE_NOCHECK(x) \
8678
({ \
87-
unsigned long __x; \
88-
compiletime_assert(sizeof(x) == sizeof(__x), \
79+
compiletime_assert(sizeof(x) == sizeof(unsigned long), \
8980
"Unsupported access size for READ_ONCE_NOCHECK()."); \
90-
__x = __read_once_word_nocheck(&(x)); \
91-
smp_read_barrier_depends(); \
92-
(typeof(x))__x; \
81+
(typeof(x))__read_once_word_nocheck(&(x)); \
9382
})
9483

9584
static __no_kasan_or_inline

0 commit comments

Comments
 (0)