summaryrefslogtreecommitdiffstats
path: root/include/linux/spinlock.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-11-26 16:27:17 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-11-26 16:27:17 -0800
commitb8e6ec865fd1d8838b6ce9516977b65e9f08f876 (patch)
tree9203493fc47d1ff55bee5c2a68884215257ad0bf /include/linux/spinlock.h
parent137b529e4df7b9cd6b235654a3f1a8f280e3463d (diff)
downloadop-kernel-dev-b8e6ec865fd1d8838b6ce9516977b65e9f08f876.zip
op-kernel-dev-b8e6ec865fd1d8838b6ce9516977b65e9f08f876.tar.gz
Revert "[PATCH] Enforce "unsigned long flags;" when spinlocking"
This reverts commit ee3ce191e8eaa4cc15c51a28b34143b36404c4f5, since it broke on at least ARM, MIPS and PA-RISC due to complicated header file dependencies. Conflicts in include/linux/spinlock.h (due to the "nested" variety fixes) fixed up by hand. Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Kyle McMartin <kyle@parisc-linux.org> Cc: Russell King <rmk+lkml@arm.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/spinlock.h')
-rw-r--r--include/linux/spinlock.h69
1 files changed, 15 insertions, 54 deletions
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 57f670d..8451052 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -52,7 +52,6 @@
#include <linux/thread_info.h>
#include <linux/kernel.h>
#include <linux/stringify.h>
-#include <linux/irqflags.h>
#include <asm/system.h>
@@ -184,52 +183,24 @@ do { \
#define read_lock(lock) _read_lock(lock)
#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
-#define spin_lock_irqsave(lock, flags) \
- do { \
- BUILD_CHECK_IRQ_FLAGS(flags); \
- flags = _spin_lock_irqsave(lock); \
- } while (0)
-#define read_lock_irqsave(lock, flags) \
- do { \
- BUILD_CHECK_IRQ_FLAGS(flags); \
- flags = _read_lock_irqsave(lock); \
- } while (0)
-#define write_lock_irqsave(lock, flags) \
- do { \
- BUILD_CHECK_IRQ_FLAGS(flags); \
- flags = _write_lock_irqsave(lock); \
- } while (0)
+
+#define spin_lock_irqsave(lock, flags) flags = _spin_lock_irqsave(lock)
+#define read_lock_irqsave(lock, flags) flags = _read_lock_irqsave(lock)
+#define write_lock_irqsave(lock, flags) flags = _write_lock_irqsave(lock)
#ifdef CONFIG_DEBUG_LOCK_ALLOC
-#define spin_lock_irqsave_nested(lock, flags, subclass) \
- do { \
- BUILD_CHECK_IRQ_FLAGS(flags); \
- flags = _spin_lock_irqsave_nested(lock, subclass); \
- } while (0)
+#define spin_lock_irqsave_nested(lock, flags, subclass) \
+ flags = _spin_lock_irqsave_nested(lock, subclass)
#else
-#define spin_lock_irqsave_nested(lock, flags, subclass) \
- do { \
- BUILD_CHECK_IRQ_FLAGS(flags); \
- flags = _spin_lock_irqsave(lock); \
- } while (0)
+#define spin_lock_irqsave_nested(lock, flags, subclass) \
+ flags = _spin_lock_irqsave(lock)
#endif
#else
-#define spin_lock_irqsave(lock, flags) \
- do { \
- BUILD_CHECK_IRQ_FLAGS(flags); \
- _spin_lock_irqsave(lock, flags); \
- } while (0)
-#define read_lock_irqsave(lock, flags) \
- do { \
- BUILD_CHECK_IRQ_FLAGS(flags); \
- _read_lock_irqsave(lock, flags); \
- } while (0)
-#define write_lock_irqsave(lock, flags) \
- do { \
- BUILD_CHECK_IRQ_FLAGS(flags); \
- _write_lock_irqsave(lock, flags); \
- } while (0)
+
+#define spin_lock_irqsave(lock, flags) _spin_lock_irqsave(lock, flags)
+#define read_lock_irqsave(lock, flags) _read_lock_irqsave(lock, flags)
+#define write_lock_irqsave(lock, flags) _write_lock_irqsave(lock, flags)
#define spin_lock_irqsave_nested(lock, flags, subclass) \
spin_lock_irqsave(lock, flags)
@@ -268,24 +239,15 @@ do { \
#endif
#define spin_unlock_irqrestore(lock, flags) \
- do { \
- BUILD_CHECK_IRQ_FLAGS(flags); \
- _spin_unlock_irqrestore(lock, flags); \
- } while (0)
+ _spin_unlock_irqrestore(lock, flags)
#define spin_unlock_bh(lock) _spin_unlock_bh(lock)
#define read_unlock_irqrestore(lock, flags) \
- do { \
- BUILD_CHECK_IRQ_FLAGS(flags); \
- _read_unlock_irqrestore(lock, flags); \
- } while (0)
+ _read_unlock_irqrestore(lock, flags)
#define read_unlock_bh(lock) _read_unlock_bh(lock)
#define write_unlock_irqrestore(lock, flags) \
- do { \
- BUILD_CHECK_IRQ_FLAGS(flags); \
- _write_unlock_irqrestore(lock, flags); \
- } while (0)
+ _write_unlock_irqrestore(lock, flags)
#define write_unlock_bh(lock) _write_unlock_bh(lock)
#define spin_trylock_bh(lock) __cond_lock(lock, _spin_trylock_bh(lock))
@@ -299,7 +261,6 @@ do { \
#define spin_trylock_irqsave(lock, flags) \
({ \
- BUILD_CHECK_IRQ_FLAGS(flags); \
local_irq_save(flags); \
spin_trylock(lock) ? \
1 : ({ local_irq_restore(flags); 0; }); \
OpenPOWER on IntegriCloud