Skip to contentSkip to conversation

Documentation/atomic_ops.txt: avoid volatile in sample code

PATCH New Nikanth Karthikesan 1 participant 1 message Mar 24, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

Documentation/atomic_ops.txt +1 -1
index ac4d471..3bd585b 100644
@@ -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.