[PATCH] Documentation/atomic_ops.txt: avoid volatile in sample code

From: Nikanth Karthikesan
Date: Thu Mar 24 2011 - 00:59:18 EST


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@xxxxxxx>

---

diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt
index ac4d471..3bd585b 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/