[PATCH] zcache: Use WARN_ON_SMP in ASSERT_SPINLOCK
Jörg Sommer
joerg at alea.gnuu.de
Sun Mar 11 21:00:54 UTC 2012
As the description of WARN_ON_SMP in bug.h says, one can not use
spin_is_locked() in assertions for non‐SMP configurations, because it
always returns the lock is not held. Otherwise a warning is thrown
everytime on a uniprocessor system.
---
drivers/staging/zcache/tmem.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/zcache/tmem.h b/drivers/staging/zcache/tmem.h
index ed147c4..b543694 100644
--- a/drivers/staging/zcache/tmem.h
+++ b/drivers/staging/zcache/tmem.h
@@ -47,7 +47,7 @@
#define ASSERT_INVERTED_SENTINEL(_x, _y) do { } while (0)
#endif
-#define ASSERT_SPINLOCK(_l) WARN_ON(!spin_is_locked(_l))
+#define ASSERT_SPINLOCK(_l) WARN_ON_SMP(!spin_is_locked(_l))
/*
* A pool is the highest-level data structure managed by tmem and
--
1.7.9.1
More information about the devel
mailing list