linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Documentation/atomic_ops.txt: avoid volatile in sample code
@ 2011-03-24  4:55 Nikanth Karthikesan
  0 siblings, 0 replies; only message in thread
From: Nikanth Karthikesan @ 2011-03-24  4:55 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

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>

---

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.

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-24  4:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-24  4:55 [PATCH] Documentation/atomic_ops.txt: avoid volatile in sample code Nikanth Karthikesan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).