linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Frederic Weisbecker <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: akpm@linux-foundation.org, torvalds@linux-foundation.org,
	frederic@kernel.org, peterz@infradead.org, tglx@linutronix.de,
	mingo@kernel.org, hpa@zytor.com, paulmck@linux.vnet.ibm.com,
	will.deacon@arm.com, linux-kernel@vger.kernel.org
Subject: [tip:locking/core] locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING
Date: Thu, 18 Apr 2019 04:26:04 -0700	[thread overview]
Message-ID: <tip-0d2cc3b3453254f1c56f9456ba03e092ed4cfb72@git.kernel.org> (raw)
In-Reply-To: <20190402160244.32434-2-frederic@kernel.org>

Commit-ID:  0d2cc3b3453254f1c56f9456ba03e092ed4cfb72
Gitweb:     https://git.kernel.org/tip/0d2cc3b3453254f1c56f9456ba03e092ed4cfb72
Author:     Frederic Weisbecker <frederic@kernel.org>
AuthorDate: Tue, 2 Apr 2019 18:02:41 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 18 Apr 2019 12:50:17 +0200

locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING

valid_state() and print_usage_bug*() functions are not used beyond
irq locking correctness checks under CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING.

Sadly the "unused function" warning wouldn't fire because valid_state()
is inline so the unused case has remained unseen until now.

So move them inside the appropriate CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING
section.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Link: https://lkml.kernel.org/r/20190402160244.32434-2-frederic@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/locking/lockdep.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 34cdcbedda49..9c5819ef4a28 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -2784,6 +2784,12 @@ static void check_chain_key(struct task_struct *curr)
 #endif
 }
 
+static int mark_lock(struct task_struct *curr, struct held_lock *this,
+		     enum lock_usage_bit new_bit);
+
+#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING)
+
+
 static void
 print_usage_bug_scenario(struct held_lock *lock)
 {
@@ -2853,10 +2859,6 @@ valid_state(struct task_struct *curr, struct held_lock *this,
 	return 1;
 }
 
-static int mark_lock(struct task_struct *curr, struct held_lock *this,
-		     enum lock_usage_bit new_bit);
-
-#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_PROVE_LOCKING)
 
 /*
  * print irq inversion bug:

  reply	other threads:[~2019-04-18 11:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02 16:02 [PATCH 0/4] lockdep cleanups and optimizations Frederic Weisbecker
2019-04-02 16:02 ` [PATCH 1/4] locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING Frederic Weisbecker
2019-04-18 11:26   ` tip-bot for Frederic Weisbecker [this message]
2019-04-02 16:02 ` [PATCH 2/4] locking/lockdep: Map remaining magic numbers to lock usage mask names Frederic Weisbecker
2019-04-18 11:26   ` [tip:locking/core] " tip-bot for Frederic Weisbecker
2019-04-02 16:02 ` [PATCH 3/4] locking/lockdep: Use expanded masks on find_usage_*() functions Frederic Weisbecker
2019-04-18 11:27   ` [tip:locking/core] " tip-bot for Frederic Weisbecker
2019-04-02 16:02 ` [PATCH 4/4] locking/lockdep: Test all incompatible scenario at once in check_irq_usage() Frederic Weisbecker
2019-04-09 13:03   ` Peter Zijlstra
2019-04-10  2:28     ` Frederic Weisbecker
2019-04-11 10:46       ` Peter Zijlstra
2019-04-13  0:35         ` Frederic Weisbecker
2019-04-16 11:20           ` Peter Zijlstra
2019-04-16 15:21             ` Frederic Weisbecker
2019-04-13  6:38   ` Yuyang Du
2019-04-29  6:39   ` [tip:locking/core] locking/lockdep: Test all incompatible scenarios " tip-bot for Frederic Weisbecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-0d2cc3b3453254f1c56f9456ba03e092ed4cfb72@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=frederic@kernel.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).