Re: [PATCH v3 10/25] openrisc: add spinlock implementation
From: Peter Zijlstra
Date: Wed Feb 22 2017 - 06:38:51 EST
On Wed, Feb 22, 2017 at 04:11:39AM +0900, Stafford Horne wrote:
> + lockval.tickets.owner = ACCESS_ONCE(lock->tickets.owner);
> + return !arch_spin_value_unlocked(ACCESS_ONCE(*lock));
> + struct __raw_tickets tickets = ACCESS_ONCE(lock->tickets);
> +#define arch_write_can_lock(x) (ACCESS_ONCE((x)->lock) == 0)
> +#define arch_read_can_lock(x) (ACCESS_ONCE((x)->lock) < 0x80000000)
Please, no ACCESS_ONCE() in new code, use READ_ONCE() or WRITE_ONCE().