summaryrefslogtreecommitdiffstats
path: root/arch/sparc/include/asm/atomic_32.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/include/asm/atomic_32.h')
-rw-r--r--arch/sparc/include/asm/atomic_32.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sparc/include/asm/atomic_32.h b/arch/sparc/include/asm/atomic_32.h
index f0d343c..7ae128b 100644
--- a/arch/sparc/include/asm/atomic_32.h
+++ b/arch/sparc/include/asm/atomic_32.h
@@ -25,7 +25,7 @@ extern int atomic_cmpxchg(atomic_t *, int, int);
extern int atomic_add_unless(atomic_t *, int, int);
extern void atomic_set(atomic_t *, int);
-#define atomic_read(v) ((v)->counter)
+#define atomic_read(v) (*(volatile int *)&(v)->counter)
#define atomic_add(i, v) ((void)__atomic_add_return( (int)(i), (v)))
#define atomic_sub(i, v) ((void)__atomic_add_return(-(int)(i), (v)))
OpenPOWER on IntegriCloud