diff options
Diffstat (limited to 'include/linux/compiler.h')
| -rw-r--r-- | include/linux/compiler.h | 23 | 
1 files changed, 4 insertions, 19 deletions
| diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 793c0829e3a3..1bb954842725 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -17,7 +17,6 @@  # define __release(x)	__context__(x,-1)  # define __cond_lock(x,c)	((c) ? ({ __acquire(x); 1; }) : 0)  # define __percpu	__attribute__((noderef, address_space(3))) -# define __pmem		__attribute__((noderef, address_space(5)))  #ifdef CONFIG_SPARSE_RCU_POINTER  # define __rcu		__attribute__((noderef, address_space(4)))  #else /* CONFIG_SPARSE_RCU_POINTER */ @@ -45,7 +44,6 @@ extern void __chk_io_ptr(const volatile void __iomem *);  # define __cond_lock(x,c) (c)  # define __percpu  # define __rcu -# define __pmem  # define __private  # define ACCESS_PRIVATE(p, member) ((p)->member)  #endif /* __CHECKER__ */ @@ -304,23 +302,6 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s  	__u.__val;					\  }) -/** - * smp_cond_acquire() - Spin wait for cond with ACQUIRE ordering - * @cond: boolean expression to wait for - * - * Equivalent to using smp_load_acquire() on the condition variable but employs - * the control dependency of the wait to reduce the barrier on many platforms. - * - * The control dependency provides a LOAD->STORE order, the additional RMB - * provides LOAD->LOAD order, together they provide LOAD->{LOAD,STORE} order, - * aka. ACQUIRE. - */ -#define smp_cond_acquire(cond)	do {		\ -	while (!(cond))				\ -		cpu_relax();			\ -	smp_rmb(); /* ctrl + rmb := acquire */	\ -} while (0) -  #endif /* __KERNEL__ */  #endif /* __ASSEMBLY__ */ @@ -545,10 +526,14 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s   * Similar to rcu_dereference(), but for situations where the pointed-to   * object's lifetime is managed by something other than RCU.  That   * "something other" might be reference counting or simple immortality. + * + * The seemingly unused void * variable is to validate @p is indeed a pointer + * type. All pointer types silently cast to void *.   */  #define lockless_dereference(p) \  ({ \  	typeof(p) _________p1 = READ_ONCE(p); \ +	__maybe_unused const void * const _________p2 = _________p1; \  	smp_read_barrier_depends(); /* Dependency order vs. p above. */ \  	(_________p1); \  }) |