mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
atomic_t: Cast to volatile when accessing atomic variables
In preparation for removing volatile from the atomic_t definition, this patch adds a volatile cast to all the atomic read functions. Signed-off-by: Anton Blanchard <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
e40152ee1e
commit
f3d46f9d31
20 changed files with 25 additions and 25 deletions
|
|
@ -189,7 +189,7 @@ static __inline__ void atomic_set(atomic_t *v, int i)
|
|||
|
||||
static __inline__ int atomic_read(const atomic_t *v)
|
||||
{
|
||||
return v->counter;
|
||||
return (*(volatile int *)&(v)->counter);
|
||||
}
|
||||
|
||||
/* exported interface */
|
||||
|
|
@ -286,7 +286,7 @@ atomic64_set(atomic64_t *v, s64 i)
|
|||
static __inline__ s64
|
||||
atomic64_read(const atomic64_t *v)
|
||||
{
|
||||
return v->counter;
|
||||
return (*(volatile long *)&(v)->counter);
|
||||
}
|
||||
|
||||
#define atomic64_add(i,v) ((void)(__atomic64_add_return( ((s64)(i)),(v))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue