lockdep: fix unused function warning in kernel/lockdep.c
authorIngo Molnar <mingo@elte.hu>
Tue, 25 Nov 2008 07:44:24 +0000 (08:44 +0100)
committerIngo Molnar <mingo@elte.hu>
Tue, 25 Nov 2008 08:07:03 +0000 (09:07 +0100)
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>
kernel/lockdep.c

index a4285830323352666b3c3e31b4ec04f9e7331d1b..c137953420e07946d6169e359d985bb9eeb343ba 100644 (file)
@@ -580,7 +580,8 @@ static void print_lock_class_header(struct lock_class *class, int depth)
 /*
  * printk all lock dependencies starting at <entry>:
  */
-static void print_lock_dependencies(struct lock_class *class, int depth)
+static void __used
+print_lock_dependencies(struct lock_class *class, int depth)
 {
        struct lock_list *entry;
 
This page took 0.028281 seconds and 5 git commands to generate.