From: Nikanth Karthikesan Date: Thu, 26 May 2011 23:25:13 +0000 (-0700) Subject: Documentation/atomic_ops.txt: avoid volatile in sample code X-Git-Tag: v3.0-rc1~110 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=72eef0f3af410de2c85f236140ddea61b71cfc3e;p=~emulex%2Finfiniband.git 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: Nikanth Karthikesan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt index ac4d4718712..3bd585b4492 100644 --- a/Documentation/atomic_ops.txt +++ b/Documentation/atomic_ops.txt @@ -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.