mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: john.hubbard@gmail.com
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	John Hubbard <jhubbard@nvidia.com>
Subject: [PATCH] lockdep: fix an unused variable warning
Date: Wed, 24 Jul 2019 15:54:52 -0700	[thread overview]
Message-ID: <20190724225452.24503-2-jhubbard@nvidia.com> (raw)
In-Reply-To: <20190724225452.24503-1-jhubbard@nvidia.com>

From: John Hubbard <jhubbard@nvidia.com>

For the !CONFIG_PROVE_LOCKING case, the "class" variable is left unused.
Rather than tease apart the functionality in lockdep_stats_show(), where
class is used to increment up to 15 local variables, this patch merely
adds yet another ifdef to fix the build warning.

Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
 kernel/locking/lockdep_proc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/locking/lockdep_proc.c b/kernel/locking/lockdep_proc.c
index 65b6a1600c8f..86f0868a1bfc 100644
--- a/kernel/locking/lockdep_proc.c
+++ b/kernel/locking/lockdep_proc.c
@@ -200,7 +200,9 @@ static void lockdep_stats_debug_show(struct seq_file *m)
 
 static int lockdep_stats_show(struct seq_file *m, void *v)
 {
+#ifdef CONFIG_PROVE_LOCKING
 	struct lock_class *class;
+#endif
 	unsigned long nr_unused = 0, nr_uncategorized = 0,
 		      nr_irq_safe = 0, nr_irq_unsafe = 0,
 		      nr_softirq_safe = 0, nr_softirq_unsafe = 0,
-- 
2.22.0


      reply	other threads:[~2019-07-24 22:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24 22:54 [PATCH 0/1] " john.hubbard
2019-07-24 22:54 ` john.hubbard [this message]

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=20190724225452.24503-2-jhubbard@nvidia.com \
    --to=john.hubbard@gmail.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=will@kernel.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®