[PATCH] powerpc: reformat atomic_add_unless

Olof Johansson olof at lixom.net
Fri Jan 13 15:49:07 EST 2006


On Fri, Jan 13, 2006 at 03:38:39PM +1100, Anton Blanchard wrote:
> 
> It makes my eyes hurt.

Much better, but that crazy double-tab-plus-a-few-spaces indentation
itches a bit too. :-)

> 
> Signed-off-by: Anton Blanchard <anton at samba.org>
> ---
> 
> Index: build/include/asm-powerpc/atomic.h
> ===================================================================
> --- build.orig/include/asm-powerpc/atomic.h	2006-01-13 15:09:49.000000000 +1100
> +++ build/include/asm-powerpc/atomic.h	2006-01-13 15:18:32.000000000 +1100
> @@ -176,19 +176,19 @@
>   * Atomically adds @a to @v, so long as it was not @u.
>   * Returns non-zero if @v was not @u, and zero otherwise.
>   */
> -#define atomic_add_unless(v, a, u)							 \
> -({															 \
> -	   int c, old;											 \
> -	   c = atomic_read(v);									 \
> -	   for (;;) {											  \
> -			   if (unlikely(c == (u)))						 \
> -					   break;								  \
> -			   old = atomic_cmpxchg((v), c, c + (a));		  \
> -			   if (likely(old == c))						   \
> -					   break;								  \
> -			   c = old;										\
> -	   }													   \
> -	   c != (u);											   \
> +#define atomic_add_unless(v, a, u)					\
> +({									\
> +	   int c, old;							\
> +	   c = atomic_read(v);						\
> +	   for (;;) {							\
> +			   if (unlikely(c == (u)))			\
> +					   break;			\
> +			   old = atomic_cmpxchg((v), c, c + (a));	\
> +			   if (likely(old == c))			\
> +					   break;			\
> +			   c = old;					\
> +	   }								\
> +	   c != (u);							\
>  })
>  #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
>  
> _______________________________________________
> Linuxppc64-dev mailing list
> Linuxppc64-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc64-dev



More information about the Linuxppc64-dev mailing list