[PATCH] powerpc: reformat atomic_add_unless

Anton Blanchard anton at samba.org
Fri Jan 13 15:38:39 EST 2006


It makes my eyes hurt.

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)
 



More information about the Linuxppc64-dev mailing list