locking/lockdep: hide unused 'class' variable
PATCH 1/1 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]
--- kernel/locking/lockdep_proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/locking/lockdep_proc.c +2 -1
@@ -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 )
Signature · 1 line
2.20.0
Whoops..... Thanks.
Quoted 36 lines · Arnd Bergmann
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 <[email protected]>--- kernel/locking/lockdep_proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)kernel/locking/lockdep_proc.c +2
-2@@ -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
tip-bot for Arnd Bergmann
merge bot[tip:locking/core] locking/lockdep: Hide unused 'class' variable
In reply to Arnd Bergmannlocking/lockdep: Hide unused 'class' variable
Commit-ID: 68037aa78208f34bda4e5cd76c357f718b838cbb Gitweb: https://git.kernel.org/tip/68037aa78208f34bda4e5cd76c357f718b838cbb Author: Arnd Bergmann <[email protected]> AuthorDate: Mon, 15 Jul 2019 11:27:49 +0200 Committer: Ingo Molnar <[email protected]> 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]
--- kernel/locking/lockdep_proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/locking/lockdep_proc.c +2 -1
@@ -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 )