LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [M68KNOMMU]: avoid unneccessary use of xchg() in set_mb()
@ 2008-02-12 6:08 Greg Ungerer
0 siblings, 0 replies; only message in thread
From: Greg Ungerer @ 2008-02-12 6:08 UTC (permalink / raw)
To: torvalds; +Cc: gerg, linux-kernel
Avoid unneccessary use of xchg() in set_mb().
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
diff -Naurp linux-2.6.25-rc1/include/asm-m68knommu/system.h linux-2.6.x/include/asm-m68knommu/system.h
--- linux-2.6.25-rc1/include/asm-m68knommu/system.h 2008-02-11 14:50:23.000000000 +1000
+++ linux-2.6.x/include/asm-m68knommu/system.h 2008-02-12 13:58:55.000000000 +1000
@@ -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()
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-02-12 6:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-12 6:08 [M68KNOMMU]: avoid unneccessary use of xchg() in set_mb() Greg Ungerer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).