[PATCH] m68k: small system.h cleanup
authorRoman Zippel <zippel@linux-m68k.org>
Fri, 6 Oct 2006 07:43:56 +0000 (00:43 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 6 Oct 2006 15:53:41 +0000 (08:53 -0700)
avoid unnecessary xchg() use in set_mb()

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/asm-m68k/system.h

index 131a0cb..243dd13 100644 (file)
@@ -78,13 +78,13 @@ static inline int irqs_disabled(void)
 #define mb()           barrier()
 #define rmb()          barrier()
 #define wmb()          barrier()
-#define read_barrier_depends() do { } while(0)
-#define set_mb(var, value)    do { xchg(&var, value); } while (0)
+#define read_barrier_depends() ((void)0)
+#define set_mb(var, value)     ({ (var) = (value); wmb(); })
 
 #define smp_mb()       barrier()
 #define smp_rmb()      barrier()
 #define smp_wmb()      barrier()
-#define smp_read_barrier_depends()     do { } while(0)
+#define smp_read_barrier_depends()     ((void)0)
 
 
 #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))