mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yang Shi <yang.shi@linaro.org>
To: peterz@infradead.org, mingo@redhat.com
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
	linaro-kernel@lists.linaro.org, yang.shi@linaro.org
Subject: [PATCH] lockdep: Include print_collision and helper functions in DEBUG_LOCKDEP
Date: Wed, 13 Apr 2016 17:57:26 -0700	[thread overview]
Message-ID: <1460595446-3010-1-git-send-email-yang.shi@linaro.org> (raw)

pint_collosion and helper functions are just used when DEBUG_LOCKDEP is
selected, so include them in #ifdef CONFIG_DEBUG_LOCKDEP to avoid the below
"defined but not used" warning when DEBUG_LOCKDEP is off:

kernel/locking/lockdep.c:2051:13: warning: 'print_collision' defined but not used [-Wunused-function]
 static void print_collision(struct task_struct *curr,

Signed-off-by: Yang Shi <yang.shi@linaro.org>
---
 kernel/locking/lockdep.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 2324ba5..ed94109 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -1999,6 +1999,7 @@ static inline int get_first_held_lock(struct task_struct *curr,
 	return ++i;
 }
 
+#ifdef CONFIG_DEBUG_LOCKDEP
 /*
  * Returns the next chain_key iteration
  */
@@ -2069,6 +2070,7 @@ static void print_collision(struct task_struct *curr,
 	printk("\nstack backtrace:\n");
 	dump_stack();
 }
+#endif
 
 /*
  * Checks whether the chain and the current held locks are consistent
-- 
2.0.2

             reply	other threads:[~2016-04-14  1:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14  0:57 Yang Shi [this message]
2016-04-15 17:06 ` Kees Cook

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=1460595446-3010-1-git-send-email-yang.shi@linaro.org \
    --to=yang.shi@linaro.org \
    --cc=arnd@arndb.de \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /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

all inboxes | Powered by JetHome®