Commit 72eef0f3 authored by Nikanth Karthikesan's avatar Nikanth Karthikesan Committed by Linus Torvalds

Documentation/atomic_ops.txt: avoid volatile in sample code

As declaring counter as volatile is discouraged, it is best not to use it
in sample code as well.
Signed-off-by: default avatarNikanth Karthikesan <knikanth@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1d582723
...@@ -12,7 +12,7 @@ Also, it should be made opaque such that any kind of cast to a normal ...@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment