summaryrefslogtreecommitdiff
path: root/tools/lib/lockdep/include/liblockdep/mutex.h
diff options
context:
space:
mode:
authorS. Lockwood-Childs <sjl@dent.vctlabs.com>2014-07-07 00:17:33 -0700
committerSasha Levin <sasha.levin@oracle.com>2014-07-07 12:20:16 -0400
commitb10827814e9c81c5a14fb73c5a6e06bd85df3f94 (patch)
tree8204c0016c6fd62fb45460199a4ec6235fbf1e72 /tools/lib/lockdep/include/liblockdep/mutex.h
parent0c37c686b336aeead2f0b982f24eafaeb19435b1 (diff)
tools/liblockdep: Account for bitfield changes in lockdeps lock_acquire
Commit fb9edbe984 shortened held_lock->check from a 2-bit field to a 1-bit field. Make liblockdep compatible with the new definition by passing check=1 to lock_acquire() calls, rather than the old value check=2 (which inadvertently disabled checks by overflowing to 0). Without this fix, several of the test cases in liblockdep run_tests.sh were failing. Signed-off-by: S. Lockwood-Childs <sjl@vctlabs.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'tools/lib/lockdep/include/liblockdep/mutex.h')
-rw-r--r--tools/lib/lockdep/include/liblockdep/mutex.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/lib/lockdep/include/liblockdep/mutex.h b/tools/lib/lockdep/include/liblockdep/mutex.h
index c342f7087147..ee53a42818ca 100644
--- a/tools/lib/lockdep/include/liblockdep/mutex.h
+++ b/tools/lib/lockdep/include/liblockdep/mutex.h
@@ -35,7 +35,7 @@ static inline int __mutex_init(liblockdep_pthread_mutex_t *lock,
static inline int liblockdep_pthread_mutex_lock(liblockdep_pthread_mutex_t *lock)
{
- lock_acquire(&lock->dep_map, 0, 0, 0, 2, NULL, (unsigned long)_RET_IP_);
+ lock_acquire(&lock->dep_map, 0, 0, 0, 1, NULL, (unsigned long)_RET_IP_);
return pthread_mutex_lock(&lock->mutex);
}
@@ -47,7 +47,7 @@ static inline int liblockdep_pthread_mutex_unlock(liblockdep_pthread_mutex_t *lo
static inline int liblockdep_pthread_mutex_trylock(liblockdep_pthread_mutex_t *lock)
{
- lock_acquire(&lock->dep_map, 0, 1, 0, 2, NULL, (unsigned long)_RET_IP_);
+ lock_acquire(&lock->dep_map, 0, 1, 0, 1, NULL, (unsigned long)_RET_IP_);
return pthread_mutex_trylock(&lock->mutex) == 0 ? 1 : 0;
}