From: Greg Ungerer Date: Fri, 15 Feb 2008 03:31:25 +0000 (-0800) Subject: m68knommu: avoid unneccessary use of xchg() in set_mb() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=091b76d6aa788d8294caa2895cea1013f3eff7da;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git m68knommu: avoid unneccessary use of xchg() in set_mb() Avoid unneccessary use of xchg() in set_mb(). Signed-off-by: Greg Ungerer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h index 039ab3f81732..64c64432bbb8 100644 --- a/include/asm-m68knommu/system.h +++ b/include/asm-m68knommu/system.h @@ -104,7 +104,7 @@ asmlinkage void resume(void); #define mb() asm volatile ("" : : :"memory") #define rmb() asm volatile ("" : : :"memory") #define wmb() asm volatile ("" : : :"memory") -#define set_mb(var, value) do { xchg(&var, value); } while (0) +#define set_mb(var, value) ({ (var) = (value); wmb(); }) #ifdef CONFIG_SMP #define smp_mb() mb()