[CRIU] [PATCH 2/5] arm: atomic -- Use signed types for atomic_add_return/atomic_sub_return

Pavel Emelyanov xemul at parallels.com
Fri Aug 16 11:00:38 EDT 2013


On 08/15/2013 12:14 PM, Cyrill Gorcunov wrote:
> 
> Just like kernel does.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  arch/arm/include/asm/atomic.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 


> @@ -66,9 +66,9 @@ static inline unsigned int atomic_sub_return(int i, atomic_t *v)
>  	return result;
>  }
>  
> -static inline unsigned int atomic_inc(atomic_t *v) { return atomic_add_return(1, v) - 1; }
> +static inline int atomic_inc(atomic_t *v) { return atomic_add_return(1, v) - 1; }
>  
> -static inline unsigned int atomic_dec(atomic_t *v) { return atomic_sub_return(1, v) + 1; }
> +static inline int atomic_dec(atomic_t *v) { return atomic_sub_return(1, v) + 1; }
>  
>  /* true if the result is 0, or false for all other cases. */
>  #define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)

There's also and atomic_inc here now :\ Would you rebase please.


More information about the CRIU mailing list