aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/atomic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/atomic.h')
-rw-r--r--include/asm-generic/atomic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
index d4d7e337fdcb..74f1a3704d7a 100644
--- a/include/asm-generic/atomic.h
+++ b/include/asm-generic/atomic.h
@@ -127,7 +127,7 @@ ATOMIC_OP(xor, ^)
127 * Atomically reads the value of @v. 127 * Atomically reads the value of @v.
128 */ 128 */
129#ifndef atomic_read 129#ifndef atomic_read
130#define atomic_read(v) ACCESS_ONCE((v)->counter) 130#define atomic_read(v) READ_ONCE((v)->counter)
131#endif 131#endif
132 132
133/** 133/**
@@ -137,7 +137,7 @@ ATOMIC_OP(xor, ^)
137 * 137 *
138 * Atomically sets the value of @v to @i. 138 * Atomically sets the value of @v to @i.
139 */ 139 */
140#define atomic_set(v, i) (((v)->counter) = (i)) 140#define atomic_set(v, i) WRITE_ONCE(((v)->counter), (i))
141 141
142#include <linux/irqflags.h> 142#include <linux/irqflags.h>
143 143