aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/locking/lockdep.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 2288aa2fa4c6..5e149dd78298 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -1682,9 +1682,9 @@ check_redundant(struct lock_list *root, struct lock_class *target,
1682 * without creating any illegal irq-safe -> irq-unsafe lock dependency. 1682 * without creating any illegal irq-safe -> irq-unsafe lock dependency.
1683 */ 1683 */
1684 1684
1685static inline int usage_match(struct lock_list *entry, void *bit) 1685static inline int usage_match(struct lock_list *entry, void *mask)
1686{ 1686{
1687 return entry->class->usage_mask & (1 << (enum lock_usage_bit)bit); 1687 return entry->class->usage_mask & *(unsigned long *)mask;
1688} 1688}
1689 1689
1690 1690
@@ -1700,14 +1700,14 @@ static inline int usage_match(struct lock_list *entry, void *bit)
1700 * Return <0 on error. 1700 * Return <0 on error.
1701 */ 1701 */
1702static int 1702static int
1703find_usage_forwards(struct lock_list *root, enum lock_usage_bit bit, 1703find_usage_forwards(struct lock_list *root, unsigned long usage_mask,
1704 struct lock_list **target_entry) 1704 struct lock_list **target_entry)
1705{ 1705{
1706 int result; 1706 int result;
1707 1707
1708 debug_atomic_inc(nr_find_usage_forwards_checks); 1708 debug_atomic_inc(nr_find_usage_forwards_checks);
1709 1709
1710 result = __bfs_forwards(root, (void *)bit, usage_match, target_entry); 1710 result = __bfs_forwards(root, &usage_mask, usage_match, target_entry);
1711 1711
1712 return result; 1712 return result;
1713} 1713}
@@ -1723,14 +1723,14 @@ find_usage_forwards(struct lock_list *root, enum lock_usage_bit bit,
1723 * Return <0 on error. 1723 * Return <0 on error.
1724 */ 1724 */
1725static int 1725static int
1726find_usage_backwards(struct lock_list *root, enum lock_usage_bit bit, 1726find_usage_backwards(struct lock_list *root, unsigned long usage_mask,
1727 struct lock_list **target_entry) 1727 struct lock_list **target_entry)
1728{ 1728{
1729 int result; 1729 int result;
1730 1730
1731 debug_atomic_inc(nr_find_usage_backwards_checks); 1731 debug_atomic_inc(nr_find_usage_backwards_checks);
1732 1732
1733 result = __bfs_backwards(root, (void *)bit, usage_match, target_entry); 1733 result = __bfs_backwards(root, &usage_mask, usage_match, target_entry);
1734 1734
1735 return result; 1735 return result;
1736} 1736}
@@ -1935,7 +1935,7 @@ check_usage(struct task_struct *curr, struct held_lock *prev,
1935 this.parent = NULL; 1935 this.parent = NULL;
1936 1936
1937 this.class = hlock_class(prev); 1937 this.class = hlock_class(prev);
1938 ret = find_usage_backwards(&this, bit_backwards, &target_entry); 1938 ret = find_usage_backwards(&this, lock_flag(bit_backwards), &target_entry);
1939 if (ret < 0) 1939 if (ret < 0)
1940 return print_bfs_bug(ret); 1940 return print_bfs_bug(ret);
1941 if (ret == 1) 1941 if (ret == 1)
@@ -1943,7 +1943,7 @@ check_usage(struct task_struct *curr, struct held_lock *prev,
1943 1943
1944 that.parent = NULL; 1944 that.parent = NULL;
1945 that.class = hlock_class(next); 1945 that.class = hlock_class(next);
1946 ret = find_usage_forwards(&that, bit_forwards, &target_entry1); 1946 ret = find_usage_forwards(&that, lock_flag(bit_forwards), &target_entry1);
1947 if (ret < 0) 1947 if (ret < 0)
1948 return print_bfs_bug(ret); 1948 return print_bfs_bug(ret);
1949 if (ret == 1) 1949 if (ret == 1)
@@ -2941,7 +2941,7 @@ check_usage_forwards(struct task_struct *curr, struct held_lock *this,
2941 2941
2942 root.parent = NULL; 2942 root.parent = NULL;
2943 root.class = hlock_class(this); 2943 root.class = hlock_class(this);
2944 ret = find_usage_forwards(&root, bit, &target_entry); 2944 ret = find_usage_forwards(&root, lock_flag(bit), &target_entry);
2945 if (ret < 0) 2945 if (ret < 0)
2946 return print_bfs_bug(ret); 2946 return print_bfs_bug(ret);
2947 if (ret == 1) 2947 if (ret == 1)
@@ -2965,7 +2965,7 @@ check_usage_backwards(struct task_struct *curr, struct held_lock *this,
2965 2965
2966 root.parent = NULL; 2966 root.parent = NULL;
2967 root.class = hlock_class(this); 2967 root.class = hlock_class(this);
2968 ret = find_usage_backwards(&root, bit, &target_entry); 2968 ret = find_usage_backwards(&root, lock_flag(bit), &target_entry);
2969 if (ret < 0) 2969 if (ret < 0)
2970 return print_bfs_bug(ret); 2970 return print_bfs_bug(ret);
2971 if (ret == 1) 2971 if (ret == 1)