Skip to content

Commit 72eef0f

Browse files
Nikanth Karthikesantorvalds
authored andcommitted
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>
1 parent 1d58272 commit 72eef0f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Documentation/atomic_ops.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Also, it should be made opaque such that any kind of cast to a normal
1212
C integer type will fail. Something like the following should
1313
suffice:
1414

15-
typedef struct { volatile int counter; } atomic_t;
15+
typedef struct { int counter; } atomic_t;
1616

1717
Historically, counter has been declared volatile. This is now discouraged.
1818
See Documentation/volatile-considered-harmful.txt for the complete rationale.

0 commit comments

Comments
 (0)