Skip to content

Commit

Permalink
x86[-64]:Remove 'volatile' from atomic_t
Browse files Browse the repository at this point in the history
Any code that relies on the volatile would be a bug waiting to happen
anyway.

Don't encourage people to think that putting 'volatile' on data
structures somehow fixes problems.  We should always use proper locking
(and other serialization) techniques.

Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Linus Torvalds committed Dec 6, 2006
1 parent 16afea0 commit f9e9dcb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/asm-i386/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* on us. We need to use _exactly_ the address the user gave us,
* not some alias that contains the same information.
*/
typedef struct { volatile int counter; } atomic_t;
typedef struct { int counter; } atomic_t;

#define ATOMIC_INIT(i) { (i) }

Expand Down
2 changes: 1 addition & 1 deletion include/asm-x86_64/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* on us. We need to use _exactly_ the address the user gave us,
* not some alias that contains the same information.
*/
typedef struct { volatile int counter; } atomic_t;
typedef struct { int counter; } atomic_t;

#define ATOMIC_INIT(i) { (i) }

Expand Down

0 comments on commit f9e9dcb

Please sign in to comment.