Skip to content

Commit

Permalink
Documentation/atomic_ops.txt: avoid volatile in sample code
Browse files Browse the repository at this point in the history
As declaring counter as volatile is discouraged, it is best not to use it
in sample code as well.

Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Nikanth Karthikesan authored and torvalds committed May 27, 2011
1 parent 1d58272 commit 72eef0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/atomic_ops.txt
Expand Up @@ -12,7 +12,7 @@ Also, it should be made opaque such that any kind of cast to a normal
C integer type will fail. Something like the following should C integer type will fail. Something like the following should
suffice: suffice:


typedef struct { volatile int counter; } atomic_t; typedef struct { int counter; } atomic_t;


Historically, counter has been declared volatile. This is now discouraged. Historically, counter has been declared volatile. This is now discouraged.
See Documentation/volatile-considered-harmful.txt for the complete rationale. See Documentation/volatile-considered-harmful.txt for the complete rationale.
Expand Down

0 comments on commit 72eef0f

Please sign in to comment.