[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 1/5] asm-arm/atomic.h: fix arm32|arm64 macros duplication



On Wed, 13 Jul 2016, Corneliu ZUZU wrote:
> Move duplicate macros between asm-arm/arm32/atomic.h and 
> asm-arm/arm64/atomic.h
> to asm-arm/atomic.h.
> 
> Signed-off-by: Corneliu ZUZU <czuzu@xxxxxxxxxxxxxxx>

Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>


>  xen/include/asm-arm/arm32/atomic.h | 11 -----------
>  xen/include/asm-arm/arm64/atomic.h | 11 -----------
>  xen/include/asm-arm/atomic.h       | 11 +++++++++++
>  3 files changed, 11 insertions(+), 22 deletions(-)
> 
> diff --git a/xen/include/asm-arm/arm32/atomic.h 
> b/xen/include/asm-arm/arm32/atomic.h
> index 7ec712f..be08ff1 100644
> --- a/xen/include/asm-arm/arm32/atomic.h
> +++ b/xen/include/asm-arm/arm32/atomic.h
> @@ -149,17 +149,6 @@ static inline int __atomic_add_unless(atomic_t *v, int 
> a, int u)
>  
>  #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
>  
> -#define atomic_inc(v)                atomic_add(1, v)
> -#define atomic_dec(v)                atomic_sub(1, v)
> -
> -#define atomic_inc_and_test(v)       (atomic_add_return(1, v) == 0)
> -#define atomic_dec_and_test(v)       (atomic_sub_return(1, v) == 0)
> -#define atomic_inc_return(v)    (atomic_add_return(1, v))
> -#define atomic_dec_return(v)    (atomic_sub_return(1, v))
> -#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0)
> -
> -#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0)
> -
>  #endif /* __ARCH_ARM_ARM32_ATOMIC__ */
>  /*
>   * Local variables:
> diff --git a/xen/include/asm-arm/arm64/atomic.h 
> b/xen/include/asm-arm/arm64/atomic.h
> index b49219e..80d07bf 100644
> --- a/xen/include/asm-arm/arm64/atomic.h
> +++ b/xen/include/asm-arm/arm64/atomic.h
> @@ -125,17 +125,6 @@ static inline int __atomic_add_unless(atomic_t *v, int 
> a, int u)
>       return c;
>  }
>  
> -#define atomic_inc(v)                atomic_add(1, v)
> -#define atomic_dec(v)                atomic_sub(1, v)
> -
> -#define atomic_inc_and_test(v)       (atomic_add_return(1, v) == 0)
> -#define atomic_dec_and_test(v)       (atomic_sub_return(1, v) == 0)
> -#define atomic_inc_return(v)    (atomic_add_return(1, v))
> -#define atomic_dec_return(v)    (atomic_sub_return(1, v))
> -#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0)
> -
> -#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0)
> -
>  #endif
>  /*
>   * Local variables:
> diff --git a/xen/include/asm-arm/atomic.h b/xen/include/asm-arm/atomic.h
> index 29ab265..41d1b6c 100644
> --- a/xen/include/asm-arm/atomic.h
> +++ b/xen/include/asm-arm/atomic.h
> @@ -138,6 +138,17 @@ static inline void _atomic_set(atomic_t *v, int i)
>  # error "unknown ARM variant"
>  #endif
>  
> +#define atomic_inc(v)       atomic_add(1, v)
> +#define atomic_dec(v)       atomic_sub(1, v)
> +
> +#define atomic_inc_and_test(v)  (atomic_add_return(1, v) == 0)
> +#define atomic_dec_and_test(v)  (atomic_sub_return(1, v) == 0)
> +#define atomic_inc_return(v)    (atomic_add_return(1, v))
> +#define atomic_dec_return(v)    (atomic_sub_return(1, v))
> +#define atomic_sub_and_test(i, v) (atomic_sub_return(i, v) == 0)
> +
> +#define atomic_add_negative(i,v) (atomic_add_return(i, v) < 0)
> +
>  #endif /* __ARCH_ARM_ATOMIC__ */
>  /*
>   * Local variables:
> -- 
> 2.5.0
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.