lkml.org 
[lkml]   [2020]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH-tip 1/3] locking/lockdep: Make remove_class_from_lock_chains() depend on CONFIG_PROVE_LOCKING
Date
The remove_class_from_lock_chains() is essentially an no-op if
CONFIG_PROVE_LOCKING isn't enabled. Make it so.

Signed-off-by: Waiman Long <longman@redhat.com>
---
kernel/locking/lockdep.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index e55c4ee14e64..3dad36e2187b 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4998,12 +4998,12 @@ void lockdep_reset(void)
raw_local_irq_restore(flags);
}

+#ifdef CONFIG_PROVE_LOCKING
/* Remove a class from a lock chain. Must be called with the graph lock held. */
static void remove_class_from_lock_chain(struct pending_free *pf,
struct lock_chain *chain,
struct lock_class *class)
{
-#ifdef CONFIG_PROVE_LOCKING
int i;

for (i = chain->base; i < chain->base + chain->depth; i++) {
@@ -5031,13 +5031,14 @@ static void remove_class_from_lock_chain(struct pending_free *pf,
hlist_del_rcu(&chain->entry);
__set_bit(chain - lock_chains, pf->lock_chains_being_freed);
nr_zapped_lock_chains++;
-#endif
}
+#endif

/* Must be called with the graph lock held. */
static void remove_class_from_lock_chains(struct pending_free *pf,
struct lock_class *class)
{
+#ifdef CONFIG_PROVE_LOCKING
struct lock_chain *chain;
struct hlist_head *head;
int i;
@@ -5048,6 +5049,7 @@ static void remove_class_from_lock_chains(struct pending_free *pf,
remove_class_from_lock_chain(pf, chain, class);
}
}
+#endif
}

/*
--
2.18.1
\
 
 \ /
  Last update: 2020-02-12 16:39    [W:0.058 / U:1.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site