From d356b595e5a95c0c2305ec0a7d1cdb3e26f57716 Mon Sep 17 00:00:00 2001 From: Chris Metcalf Date: Fri, 25 Feb 2011 08:46:38 -0500 Subject: 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 . Signed-off-by: Chris Metcalf --- arch/tile/include/asm/atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/tile/include/asm/atomic.h b/arch/tile/include/asm/atomic.h index b8c49f98a44c..75a16028a952 100644 --- a/arch/tile/include/asm/atomic.h +++ b/arch/tile/include/asm/atomic.h @@ -32,7 +32,7 @@ */ static inline int atomic_read(const atomic_t *v) { - return v->counter; + return ACCESS_ONCE(v->counter); } /** -- cgit v1.2.1