Skip to contentSkip to conversation

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

PATCH New Chris Metcalf 1 participant 1 message Mar 1, 2011 1 message not in the archive Atomic infrastructure

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1297703506.5226.121.camel@laptop

#1 lore raw

PATCH 1/1 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 <[email protected]>.

---
 arch/tile/include/asm/atomic.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/tile/include/asm/atomic.h +1 -1
index b8c49f9..75a1602 100644
@@ -32,7 +32,7 @@
  */
 static inline int atomic_read(const atomic_t *v)
 {
-       return v->counter;
+	return ACCESS_ONCE(v->counter);
 }
 
 /**
Signature · 1 line
1.6.5.2