Просмотр исходного кода

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>
Chris Metcalf 15 лет назад
Родитель
Сommit
d356b595e5
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      arch/tile/include/asm/atomic.h

+ 1 - 1
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);
 }
 
 /**