Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Nikanth Karthikesan and committed by
Linus Torvalds
72eef0f3 1d582723

+1 -1
+1 -1
Documentation/atomic_ops.txt
··· 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.