Commit df60a8441866153d691ae69b77934904c2de5e0d

Authored by Stephen Hemminger
Committed by Ingo Molnar
1 parent 2df8b1d656

lockdep: fix build if CONFIG_PROVE_LOCKING not defined

If CONFIG_PROVE_LOCKING not defined, then no dependency information
is available.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff

kernel/lockdep_proc.c
... ... @@ -82,7 +82,6 @@
82 82  
83 83 static int l_show(struct seq_file *m, void *v)
84 84 {
85   - unsigned long nr_forward_deps, nr_backward_deps;
86 85 struct lock_class *class = v;
87 86 struct lock_list *entry;
88 87 char c1, c2, c3, c4;
89 88  
... ... @@ -96,12 +95,11 @@
96 95 #ifdef CONFIG_DEBUG_LOCKDEP
97 96 seq_printf(m, " OPS:%8ld", class->ops);
98 97 #endif
99   - nr_forward_deps = lockdep_count_forward_deps(class);
100   - seq_printf(m, " FD:%5ld", nr_forward_deps);
  98 +#ifdef CONFIG_PROVE_LOCKING
  99 + seq_printf(m, " FD:%5ld", lockdep_count_forward_deps(class));
  100 + seq_printf(m, " BD:%5ld", lockdep_count_backward_deps(class));
  101 +#endif
101 102  
102   - nr_backward_deps = lockdep_count_backward_deps(class);
103   - seq_printf(m, " BD:%5ld", nr_backward_deps);
104   -
105 103 get_usage_chars(class, &c1, &c2, &c3, &c4);
106 104 seq_printf(m, " %c%c%c%c", c1, c2, c3, c4);
107 105  
108 106  
... ... @@ -325,7 +323,9 @@
325 323 if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ)
326 324 nr_hardirq_read_unsafe++;
327 325  
  326 +#ifdef CONFIG_PROVE_LOCKING
328 327 sum_forward_deps += lockdep_count_forward_deps(class);
  328 +#endif
329 329 }
330 330 #ifdef CONFIG_DEBUG_LOCKDEP
331 331 DEBUG_LOCKS_WARN_ON(debug_atomic_read(&nr_unused_locks) != nr_unused);