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]
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -200,7 +200,6 @@ static void lockdep_stats_debug_show(struct seq_file *m) · 199 unmodified lines | ||
| 200 | 200 | |
| 201 | 201 | static int lockdep_stats_show(struct seq_file *m, void *v) |
| 202 | 202 | { |
| 203 | − struct lock_class *class; | |
| 204 | 203 | unsigned long nr_unused = 0, nr_uncategorized = 0, |
| 205 | 204 | nr_irq_safe = 0, nr_irq_unsafe = 0, |
| 206 | 205 | nr_softirq_safe = 0, nr_softirq_unsafe = 0, |
| @@ -211,6 +210,8 @@ static int lockdep_stats_show(struct seq_file *m, void *v) · 4 unmodified lines | ||
| 211 | 210 | sum_forward_deps = 0; |
| 212 | 211 | |
| 213 | 212 | #ifdef CONFIG_PROVE_LOCKING |
| 213 | + struct lock_class *class; | |
| 214 | + | |
| 214 | 215 | list_for_each_entry(class, &all_lock_classes, lock_entry) { |
| 215 | 216 | |
| 216 | 217 | if (class->usage_mask == 0) |