Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arch/tile: Fix atomic_read() definition to use ACCESS_ONCE

This adds the volatile cast which forces the compiler to emit the load.
Suggested by Peter Zijlstra <peterz@infradead.org>.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

+1 -1
+1 -1
arch/tile/include/asm/atomic.h
··· 32 32 */ 33 33 static inline int atomic_read(const atomic_t *v) 34 34 { 35 - return v->counter; 35 + return ACCESS_ONCE(v->counter); 36 36 } 37 37 38 38 /**