Skip to content

Commit

Permalink
MN10300: atomic_read() should ensure it emits a load
Browse files Browse the repository at this point in the history
atomic_read() needs to ensure that it emits a load (which it can do by using
ACCESS_ONCE()).

Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
David Howells committed Mar 14, 2011
1 parent dcca52c commit af79420
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/mn10300/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static inline unsigned long __cmpxchg(volatile unsigned long *m,
* Atomically reads the value of @v. Note that the guaranteed
* useful range of an atomic_t is only 24 bits.
*/
#define atomic_read(v) ((v)->counter)
#define atomic_read(v) (ACCESS_ONCE((v)->counter))

/**
* atomic_set - set atomic variable
Expand Down

0 comments on commit af79420

Please sign in to comment.