Skip to content

Commit 68037aa

Browse files
arndbIngo Molnar
authored andcommitted
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Bart Van Assche <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Qian Cai <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Waiman Long <[email protected]> Cc: Will Deacon <[email protected]> Cc: Will Deacon <[email protected]> Cc: Yuyang Du <[email protected]> Cc: [email protected] Fixes: 68d41d8 ("locking/lockdep: Fix lock used or unused stats error") Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 6ffddfb commit 68037aa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/locking/lockdep_proc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ static void lockdep_stats_debug_show(struct seq_file *m)
200200

201201
static int lockdep_stats_show(struct seq_file *m, void *v)
202202
{
203-
struct lock_class *class;
204203
unsigned long nr_unused = 0, nr_uncategorized = 0,
205204
nr_irq_safe = 0, nr_irq_unsafe = 0,
206205
nr_softirq_safe = 0, nr_softirq_unsafe = 0,
@@ -211,6 +210,8 @@ static int lockdep_stats_show(struct seq_file *m, void *v)
211210
sum_forward_deps = 0;
212211

213212
#ifdef CONFIG_PROVE_LOCKING
213+
struct lock_class *class;
214+
214215
list_for_each_entry(class, &all_lock_classes, lock_entry) {
215216

216217
if (class->usage_mask == 0)

0 commit comments

Comments
 (0)