Skip to content

Commit

Permalink
lockdep: fix unused function warning in kernel/lockdep.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ingo Molnar committed Nov 25, 2008
1 parent 7918baa commit 7807faf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7807faf

Please sign in to comment.