Skip to content

Commit af79420

Browse files
committed
MN10300: atomic_read() should ensure it emits a load
atomic_read() needs to ensure that it emits a load (which it can do by using ACCESS_ONCE()). Reported-by: Peter Zijlstra <[email protected]> Signed-off-by: David Howells <[email protected]>
1 parent dcca52c commit af79420

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mn10300/include/asm/atomic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static inline unsigned long __cmpxchg(volatile unsigned long *m,
139139
* Atomically reads the value of @v. Note that the guaranteed
140140
* useful range of an atomic_t is only 24 bits.
141141
*/
142-
#define atomic_read(v) ((v)->counter)
142+
#define atomic_read(v) (ACCESS_ONCE((v)->counter))
143143

144144
/**
145145
* atomic_set - set atomic variable

0 commit comments

Comments
 (0)