LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] locking/lockdep: hide unused 'class' variable
@ 2019-07-15  9:27 Arnd Bergmann
  2019-07-17  5:32 ` Yuyang Du
  2019-07-25 16:03 ` [tip:locking/core] locking/lockdep: Hide " tip-bot for Arnd Bergmann
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2019-07-15  9:27 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Will Deacon
  Cc: Arnd Bergmann, Qian Cai, Yuyang Du, Andrew Morton,
	Linus Torvalds, Paul E. McKenney, Thomas Gleixner, Will Deacon,
	frederic, Ingo Molnar, Bart Van Assche, Waiman Long,
	linux-kernel

The usage is now hidden in an #ifdef, so we need to move
the variable itself in there as well to avoid this warning:

kernel/locking/lockdep_proc.c:203:21: error: unused variable 'class' [-Werror,-Wunused-variable]

Fixes: 68d41d8c94a3 ("locking/lockdep: Fix lock used or unused stats error")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 kernel/locking/lockdep_proc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/locking/lockdep_proc.c b/kernel/locking/lockdep_proc.c
index 65b6a1600c8f..bda006f8a88b 100644
--- a/kernel/locking/lockdep_proc.c
+++ b/kernel/locking/lockdep_proc.c
@@ -200,7 +200,6 @@ static void lockdep_stats_debug_show(struct seq_file *m)
 
 static int lockdep_stats_show(struct seq_file *m, void *v)
 {
-	struct lock_class *class;
 	unsigned long nr_unused = 0, nr_uncategorized = 0,
 		      nr_irq_safe = 0, nr_irq_unsafe = 0,
 		      nr_softirq_safe = 0, nr_softirq_unsafe = 0,
@@ -211,6 +210,8 @@ static int lockdep_stats_show(struct seq_file *m, void *v)
 		      sum_forward_deps = 0;
 
 #ifdef CONFIG_PROVE_LOCKING
+	struct lock_class *class;
+
 	list_for_each_entry(class, &all_lock_classes, lock_entry) {
 
 		if (class->usage_mask == 0)
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] locking/lockdep: hide unused 'class' variable
  2019-07-15  9:27 [PATCH] locking/lockdep: hide unused 'class' variable Arnd Bergmann
@ 2019-07-17  5:32 ` Yuyang Du
  2019-07-25 16:03 ` [tip:locking/core] locking/lockdep: Hide " tip-bot for Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: Yuyang Du @ 2019-07-17  5:32 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Peter Zijlstra, Ingo Molnar, Will Deacon, Qian Cai,
	Andrew Morton, Linus Torvalds, Paul E. McKenney, Thomas Gleixner,
	Will Deacon, Frederic Weisbecker, Ingo Molnar, Bart Van Assche,
	Waiman Long, LKML

Whoops..... Thanks.

On Mon, 15 Jul 2019 at 17:28, Arnd Bergmann <arnd@arndb.de> wrote:
>
> The usage is now hidden in an #ifdef, so we need to move
> the variable itself in there as well to avoid this warning:
>
> kernel/locking/lockdep_proc.c:203:21: error: unused variable 'class' [-Werror,-Wunused-variable]
>
> Fixes: 68d41d8c94a3 ("locking/lockdep: Fix lock used or unused stats error")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  kernel/locking/lockdep_proc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/locking/lockdep_proc.c b/kernel/locking/lockdep_proc.c
> index 65b6a1600c8f..bda006f8a88b 100644
> --- a/kernel/locking/lockdep_proc.c
> +++ b/kernel/locking/lockdep_proc.c
> @@ -200,7 +200,6 @@ static void lockdep_stats_debug_show(struct seq_file *m)
>
>  static int lockdep_stats_show(struct seq_file *m, void *v)
>  {
> -       struct lock_class *class;
>         unsigned long nr_unused = 0, nr_uncategorized = 0,
>                       nr_irq_safe = 0, nr_irq_unsafe = 0,
>                       nr_softirq_safe = 0, nr_softirq_unsafe = 0,
> @@ -211,6 +210,8 @@ static int lockdep_stats_show(struct seq_file *m, void *v)
>                       sum_forward_deps = 0;
>
>  #ifdef CONFIG_PROVE_LOCKING
> +       struct lock_class *class;
> +
>         list_for_each_entry(class, &all_lock_classes, lock_entry) {
>
>                 if (class->usage_mask == 0)
> --
> 2.20.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:locking/core] locking/lockdep: Hide unused 'class' variable
  2019-07-15  9:27 [PATCH] locking/lockdep: hide unused 'class' variable Arnd Bergmann
  2019-07-17  5:32 ` Yuyang Du
@ 2019-07-25 16:03 ` tip-bot for Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Arnd Bergmann @ 2019-07-25 16:03 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: cai, akpm, will, tglx, mingo, paulmck, bvanassche, arnd,
	linux-kernel, peterz, will.deacon, torvalds, hpa, longman,
	duyuyang

Commit-ID:  68037aa78208f34bda4e5cd76c357f718b838cbb
Gitweb:     https://git.kernel.org/tip/68037aa78208f34bda4e5cd76c357f718b838cbb
Author:     Arnd Bergmann <arnd@arndb.de>
AuthorDate: Mon, 15 Jul 2019 11:27:49 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 25 Jul 2019 15:39:25 +0200

locking/lockdep: Hide unused 'class' variable

The usage is now hidden in an #ifdef, so we need to move
the variable itself in there as well to avoid this warning:

  kernel/locking/lockdep_proc.c:203:21: error: unused variable 'class' [-Werror,-Wunused-variable]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Qian Cai <cai@lca.pw>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Waiman Long <longman@redhat.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yuyang Du <duyuyang@gmail.com>
Cc: frederic@kernel.org
Fixes: 68d41d8c94a3 ("locking/lockdep: Fix lock used or unused stats error")
Link: https://lkml.kernel.org/r/20190715092809.736834-1-arnd@arndb.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/locking/lockdep_proc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/locking/lockdep_proc.c b/kernel/locking/lockdep_proc.c
index 65b6a1600c8f..bda006f8a88b 100644
--- a/kernel/locking/lockdep_proc.c
+++ b/kernel/locking/lockdep_proc.c
@@ -200,7 +200,6 @@ static void lockdep_stats_debug_show(struct seq_file *m)
 
 static int lockdep_stats_show(struct seq_file *m, void *v)
 {
-	struct lock_class *class;
 	unsigned long nr_unused = 0, nr_uncategorized = 0,
 		      nr_irq_safe = 0, nr_irq_unsafe = 0,
 		      nr_softirq_safe = 0, nr_softirq_unsafe = 0,
@@ -211,6 +210,8 @@ static int lockdep_stats_show(struct seq_file *m, void *v)
 		      sum_forward_deps = 0;
 
 #ifdef CONFIG_PROVE_LOCKING
+	struct lock_class *class;
+
 	list_for_each_entry(class, &all_lock_classes, lock_entry) {
 
 		if (class->usage_mask == 0)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-25 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15  9:27 [PATCH] locking/lockdep: hide unused 'class' variable Arnd Bergmann
2019-07-17  5:32 ` Yuyang Du
2019-07-25 16:03 ` [tip:locking/core] locking/lockdep: Hide " tip-bot for Arnd Bergmann

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).