atomic.h : atomic_t "counter" members should be volatile
PATCH 1/1 atomic.h : atomic_t "counter" members should be volatile
Make sure all typedef struct's for atomic_t have a "volatile" counter member.
Signed-off-by Robert P. J. Day <[email protected]>
---
According to what I read, it's highly recommended that that counter
member be declared with storage class "volatile". This patch just makes it consistently volatile across all architectures.
asm-frv/atomic.h | 2 +- asm-h8300/atomic.h | 2 +- asm-m68k/atomic.h | 2 +- asm-m68knommu/atomic.h | 2 +- asm-v850/atomic.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
include/asm-frv/atomic.h +1 -1
@@ -35,7 +35,7 @@ #define smp_mb__before_atomic_inc() barr#define smp_mb__after_atomic_inc () barrier()typedef struct { -int counter; +volatile int counter; }atomic_t ;#define ATOMIC_INIT (i) { (i) }
include/asm-h8300/atomic.h +1 -1
@@ -6,7 +6,7 @@ #define __ARCH_H8300_ATOMIC__* resource counting etc.. */ -typedef struct {int counter; }atomic_t ; +typedef struct {volatile int counter; }atomic_t ;#define ATOMIC_INIT (i) { (i) }#define atomic_read (v) ((v)->counter)
include/asm-m68k/atomic.h +1 -1
@@ -13,7 +13,7 @@ #include <asm/system.h> /* local_irq_XXX* We do not have SMP m68k systems, so we don't have to deal with that. */ -typedef struct {int counter; }atomic_t ; +typedef struct {volatile int counter; }atomic_t ;#define ATOMIC_INIT (i) { (i) }#define atomic_read (v) ((v)->counter)
include/asm-m68knommu/atomic.h +1 -1
@@ -12,7 +12,7 @@ #include <asm/system.h> /* local_irq_XXX* We do not have SMP m68k systems, so we don't have to deal with that. */ -typedef struct {int counter; }atomic_t ; +typedef struct {volatile int counter; }atomic_t ;#define ATOMIC_INIT (i) { (i) }#define atomic_read (v) ((v)->counter)
include/asm-v850/atomic.h +1 -1
@@ -21,7 +21,7 @@ #ifdef CONFIG_SMP#error SMP not supported#endif -typedef struct {int counter; }atomic_t ; +typedef struct {volatile int counter; }atomic_t ;#define ATOMIC_INIT (i) { (i) }