mirror of
https://github.com/torvalds/linux.git
synced 2026-11-23 23:11:40 +00:00
locking,arch: Use ACCESS_ONCE() instead of cast to volatile in atomic_read()
Use the much more reader friendly ACCESS_ONCE() instead of the cast to volatile. This is purely a stylistic change. Signed-off-by: Pranith Kumar <[email protected]> Acked-by: Jesper Nilsson <[email protected]> Acked-by: Hans-Christian Egtvedt <[email protected]> Acked-by: Max Filippov <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
committed by
Ingo Molnar
parent
da4c54457e
commit
2291059c85
@@ -126,7 +126,7 @@ ATOMIC_OP(or, |)
|
||||
* Atomically reads the value of @v.
|
||||
*/
|
||||
#ifndef atomic_read
|
||||
#define atomic_read(v) (*(volatile int *)&(v)->counter)
|
||||
#define atomic_read(v) ACCESS_ONCE((v)->counter)
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user