Documentation/atomic_ops.txt: avoid volatile in sample code
authorNikanth Karthikesan <knikanth@suse.de>
Thu, 26 May 2011 23:25:13 +0000 (16:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 27 May 2011 00:12:34 +0000 (17:12 -0700)
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>
Documentation/atomic_ops.txt

index ac4d471..3bd585b 100644 (file)
@@ -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
 suffice:
 
-       typedef struct { volatile int counter; } atomic_t;
+       typedef struct { int counter; } atomic_t;
 
 Historically, counter has been declared volatile.  This is now discouraged.
 See Documentation/volatile-considered-harmful.txt for the complete rationale.