mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: "John Kacur" <jkacur@gmail.com>, Rabin Vincent <rabin@rab.in>
Cc: linux-kernel@vger.kernel.org, David Miller <davem@davemloft.net>
Subject: [PATCH] lockdep: fix build if CONFIG_PROVE_LOCKING not defined
Date: Fri, 15 Aug 2008 09:33:05 -0700	[thread overview]
Message-ID: <20080815093305.6975ec7e@extreme> (raw)
In-Reply-To: <520f0cf10808150857u5803d86cj205e671f640c81c4@mail.gmail.com>

If CONFIG_PROVE_LOCKING not defined, then no dependency information
is available.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/kernel/lockdep_proc.c	2008-08-15 09:21:46.000000000 -0700
+++ b/kernel/lockdep_proc.c	2008-08-15 09:29:59.000000000 -0700
@@ -82,7 +82,6 @@ static void print_name(struct seq_file *
 
 static int l_show(struct seq_file *m, void *v)
 {
-	unsigned long nr_forward_deps, nr_backward_deps;
 	struct lock_class *class = v;
 	struct lock_list *entry;
 	char c1, c2, c3, c4;
@@ -96,11 +95,10 @@ static int l_show(struct seq_file *m, vo
 #ifdef CONFIG_DEBUG_LOCKDEP
 	seq_printf(m, " OPS:%8ld", class->ops);
 #endif
-	nr_forward_deps = lockdep_count_forward_deps(class);
-	seq_printf(m, " FD:%5ld", nr_forward_deps);
-
-	nr_backward_deps = lockdep_count_backward_deps(class);
-	seq_printf(m, " BD:%5ld", nr_backward_deps);
+#ifdef CONFIG_PROVE_LOCKING
+	seq_printf(m, " FD:%5ld", lockdep_count_forward_deps(class));
+	seq_printf(m, " BD:%5ld", lockdep_count_backward_deps(class));
+#endif
 
 	get_usage_chars(class, &c1, &c2, &c3, &c4);
 	seq_printf(m, " %c%c%c%c", c1, c2, c3, c4);
@@ -325,7 +323,9 @@ static int lockdep_stats_show(struct seq
 		if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ)
 			nr_hardirq_read_unsafe++;
 
+#ifdef CONFIG_PROVE_LOCKING
 		sum_forward_deps += lockdep_count_forward_deps(class);
+#endif
 	}
 #ifdef CONFIG_DEBUG_LOCKDEP
 	DEBUG_LOCKS_WARN_ON(debug_atomic_read(&nr_unused_locks) != nr_unused);

  reply	other threads:[~2008-08-15 16:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-15 15:57 [PATCH] Compile problems in locking-selftest.c with CONFIG_DEBUG_PREEMPT John Kacur
2008-08-15 16:33 ` Stephen Hemminger [this message]
2008-08-15 17:22   ` [PATCH] lockdep: fix build if CONFIG_PROVE_LOCKING not defined Ingo Molnar

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=20080815093305.6975ec7e@extreme \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=jkacur@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rabin@rab.in \
    /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®