diff options
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r-- | kernel/lockdep.c | 20 |
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; |