소스 검색

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>
Nikanth Karthikesan 14 년 전
부모
커밋
72eef0f3af
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Documentation/atomic_ops.txt

+ 1 - 1
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
 C integer type will fail.  Something like the following should
 suffice:
 suffice:
 
 
-	typedef struct { volatile int counter; } atomic_t;
+	typedef struct { int counter; } atomic_t;
 
 
 Historically, counter has been declared volatile.  This is now discouraged.
 Historically, counter has been declared volatile.  This is now discouraged.
 See Documentation/volatile-considered-harmful.txt for the complete rationale.
 See Documentation/volatile-considered-harmful.txt for the complete rationale.