Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lockdep: fix unused function warning in kernel/lockdep.c

Impact: fix build warning

this warning:

kernel/lockdep.c:584: warning: ‘print_lock_dependencies’ defined but not used

triggers because print_lock_dependencies() is only used if both
CONFIG_TRACE_IRQFLAGS and CONFIG_PROVE_LOCKING are enabled.

But adding #ifdefs is not an option here - it would spread out to 4-5
other helper functions and uglify the file. So mark this function
as __used - it's static and the compiler can eliminate it just fine.

Signed-off-by: Ingo Molnar <mingo@elte.hu>

+2 -1
+2 -1
kernel/lockdep.c
··· 580 580 /* 581 581 * printk all lock dependencies starting at <entry>: 582 582 */ 583 - static void print_lock_dependencies(struct lock_class *class, int depth) 583 + static void __used 584 + print_lock_dependencies(struct lock_class *class, int depth) 584 585 { 585 586 struct lock_list *entry; 586 587