Skip to content
This repository
Browse code

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 <knikanth@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information...
commit 72eef0f3af410de2c85f236140ddea61b71cfc3e 1 parent 1d58272
Nikanth Karthikesan authored torvalds committed

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  Documentation/atomic_ops.txt
2  Documentation/atomic_ops.txt
@@ -12,7 +12,7 @@ Also, it should be made opaque such that any kind of cast to a normal
12 12 C integer type will fail. Something like the following should
13 13 suffice:
14 14
15   - typedef struct { volatile int counter; } atomic_t;
  15 + typedef struct { int counter; } atomic_t;
16 16
17 17 Historically, counter has been declared volatile. This is now discouraged.
18 18 See Documentation/volatile-considered-harmful.txt for the complete rationale.

0 comments on commit 72eef0f

Please sign in to comment.
Something went wrong with that request. Please try again.