aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-01-27 07:58:08 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-14 17:28:17 -0500
commitcf2ad4d13c4ac6366c730fcf6c6be00db12fb75f (patch)
tree869cc14ff8790e1e3d90750cacbe24aeb0c372d9 /kernel
parent9d3651a23dc1f7ed7d207f9118459d3a73d485a7 (diff)
lockdep: remove macro usage from mark_held_locks()
Now that we have nice numerical relations for the states, remove the macro magics. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/lockdep.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 000d53a2da32..f40d916c191c 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -2099,14 +2099,6 @@ enum mark_type {
2099#undef LOCKDEP_STATE 2099#undef LOCKDEP_STATE
2100}; 2100};
2101 2101
2102#define MARK_HELD_CASE(__STATE) \
2103 case __STATE: \
2104 if (hlock->read) \
2105 usage_bit = LOCK_ENABLED_##__STATE##_READ; \
2106 else \
2107 usage_bit = LOCK_ENABLED_##__STATE; \
2108 break;
2109
2110/* 2102/*
2111 * Mark all held locks with a usage bit: 2103 * Mark all held locks with a usage bit:
2112 */ 2104 */
@@ -2120,13 +2112,11 @@ mark_held_locks(struct task_struct *curr, enum mark_type mark)
2120 for (i = 0; i < curr->lockdep_depth; i++) { 2112 for (i = 0; i < curr->lockdep_depth; i++) {
2121 hlock = curr->held_locks + i; 2113 hlock = curr->held_locks + i;
2122 2114
2123 switch (mark) { 2115 usage_bit = 2 + (mark << 2); /* ENABLED */
2124#define LOCKDEP_STATE(__STATE) MARK_HELD_CASE(__STATE) 2116 if (hlock->read)
2125#include "lockdep_states.h" 2117 usage_bit += 1; /* READ */
2126#undef LOCKDEP_STATE 2118
2127 default: 2119 BUG_ON(usage_bit >= LOCK_USAGE_STATES);
2128 BUG();
2129 }
2130 2120
2131 if (!mark_lock(curr, hlock, usage_bit)) 2121 if (!mark_lock(curr, hlock, usage_bit))
2132 return 0; 2122 return 0;