[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190519062946.27040-2-jhubbard@nvidia.com>
Date: Sat, 18 May 2019 23:29:46 -0700
From: John Hubbard <jhubbard@...dia.com>
To: LKML <linux-kernel@...r.kernel.org>,
Frederic Weisbecker <frederic@...nel.org>
CC: John Hubbard <jhubbard@...dia.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Will Deacon <will.deacon@....com>
Subject: [PATCH] lockdep: fix warning: print_lock_trace defined but not used
Commit 0d2cc3b34532 ("locking/lockdep: Move valid_state() inside
CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING") moved the only usage of
print_lock_trace() that was originally outside of the CONFIG_PROVE_LOCKING
case. It moved that usage into a different case: CONFIG_PROVE_LOCKING &&
CONFIG_TRACE_IRQFLAGS. That leaves things not symmetrical, and as a result,
the following warning fires on my build, when I have
!CONFIG_TRACE_IRQFLAGS && !CONFIG_PROVE_LOCKING
set:
kernel/locking/lockdep.c:2821:13: warning: ‘print_lock_trace’ defined
but not used [-Wunused-function]
Fix this by only defining print_lock_trace() in cases in which is it
called.
Fixes: 0d2cc3b34532 ("locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING")
Cc: Frederic Weisbecker <frederic@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Will Deacon <will.deacon@....com>
Signed-off-by: John Hubbard <jhubbard@...dia.com>
---
kernel/locking/lockdep.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index d06190fa5082..3065dc36c27a 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -2817,11 +2817,14 @@ static inline int validate_chain(struct task_struct *curr,
return 1;
}
+#if defined(CONFIG_TRACE_IRQFLAGS)
static void print_lock_trace(struct lock_trace *trace, unsigned int spaces)
{
}
#endif
+#endif
+
/*
* We are building curr_chain_key incrementally, so double-check
* it from scratch, to make sure that it's done correctly:
--
2.21.0
Powered by blists - more mailing lists