Skip to content

Commit

Permalink
tools/lib/lockdep: Fix 'set but not used' warnings
Browse files Browse the repository at this point in the history
liblockdep defines trivial macros for working with interrupt flags, as
interrupts are never disabled in userland.  This results in warnings
from gcc when -Wunused-but-set-variable is enabled, and it is enabled
by -Wall.  Fix this by evaluating the flags parameter and casting it to
void.

Signed-off-by: Ben Hutchings <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
bwhacks authored and Ingo Molnar committed Jun 5, 2017
1 parent bb7ea2a commit b016d87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/lib/lockdep/uinclude/linux/irqflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
#define raw_local_irq_disable() do { } while (0)
#define raw_local_irq_enable() do { } while (0)
#define raw_local_irq_save(flags) ((flags) = 0)
#define raw_local_irq_restore(flags) do { } while (0)
#define raw_local_irq_restore(flags) ((void)(flags))
#define raw_local_save_flags(flags) ((flags) = 0)
#define raw_irqs_disabled_flags(flags) do { } while (0)
#define raw_irqs_disabled_flags(flags) ((void)(flags))
#define raw_irqs_disabled() 0
#define raw_safe_halt()

#define local_irq_enable() do { } while (0)
#define local_irq_disable() do { } while (0)
#define local_irq_save(flags) ((flags) = 0)
#define local_irq_restore(flags) do { } while (0)
#define local_irq_restore(flags) ((void)(flags))
#define local_save_flags(flags) ((flags) = 0)
#define irqs_disabled() (1)
#define irqs_disabled_flags(flags) (0)
#define irqs_disabled_flags(flags) ((void)(flags), 0)
#define safe_halt() do { } while (0)

#define trace_lock_release(x, y)
Expand Down

0 comments on commit b016d87

Please sign in to comment.