Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1650466

[PATCH 06/21] liblockdep: Fix 'set but not used' warnings

From "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Newsgroups linux.kernel
Subject [PATCH 06/21] liblockdep: Fix 'set but not used' warnings
Date 2017-05-25 15:00 +0200
Message-ID <tL0wW-8li-29@gated-at.bofh.it> (permalink)
References <tL0wV-8li-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Ben Hutchings <ben@decadent.org.uk>

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 <ben@decadent.org.uk>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 tools/lib/lockdep/uinclude/linux/irqflags.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/lib/lockdep/uinclude/linux/irqflags.h b/tools/lib/lockdep/uinclude/linux/irqflags.h
index 6cc296f0fad0..df77669cfe1c 100644
--- a/tools/lib/lockdep/uinclude/linux/irqflags.h
+++ b/tools/lib/lockdep/uinclude/linux/irqflags.h
@@ -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)
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/21] liblockdep fixes for v4.12 "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:00 +0200
  [PATCH 10/21] tools: add install make target for liblockdep "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:00 +0200
    [tip:locking/core] tools: Add install make target for liblockdep tip-bot for Alexander Sverdlin <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 06/21] liblockdep: Fix 'set but not used' warnings "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:00 +0200
    [tip:locking/core] tools/lib/lockdep: Fix 'set but not used'  warnings tip-bot for Ben Hutchings <tipbot@zytor.com> - 2017-06-05 11:10 +0200
  [PATCH 03/21] liblockdep: Define the ARRAY_SIZE() macro "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:00 +0200
    [tip:locking/core] tools/lib/lockdep: Define the ARRAY_SIZE() macro tip-bot for Ben Hutchings <tipbot@zytor.com> - 2017-06-05 11:10 +0200
  [PATCH 11/21] tools: liblockdep: Don't mix fd-based and stream IO "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Don't mix fd-based and stream  IO tip-bot for Alexander Sverdlin <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 19/21] tools include: add IS_ERR_OR_NULL to err.h "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/include: Add IS_ERR_OR_NULL to err.h "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 09/21] MAINTAINERS: update email for Sasha Levin "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] MAINTAINERS: Update email for Sasha Levin "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:10 +0200
  [PATCH 04/21] liblockdep: Enable -Wall by default "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Enable -Wall by default tip-bot for Ben Hutchings <tipbot@zytor.com> - 2017-06-05 11:10 +0200
  [PATCH 12/21] tools: liblockdep: fix compilation for 4.11 "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Fix compilation for 4.11 "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 21/21] tools: liblockdep: hide liblockdep output from test  results "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Hide liblockdep output from  test results "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 14/21] tools: liblockdep: Remove double-quotes from soname "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Remove double-quotes from  soname tip-bot for Ben Hutchings <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 17/21] tools: liblockdep: include err.h "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Include err.h "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 15/21] tools: liblockdep: Use LDFLAGS "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Use LDFLAGS tip-bot for Ben Hutchings <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 20/21] tools: liblockdep: add dummy current_gfp_context() "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Add dummy  current_gfp_context() "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 18/21] tools: liblockdep: add empty  __is_[module,kernel]_percpu_address "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Add empty  __is_[module,kernel]_percpu_address "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 07/21] liblockdep: Fix 'defined but not used' warning for  init_utsname() "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Fix 'defined but not used'  warning for init_utsname() tip-bot for Ben Hutchings <tipbot@zytor.com> - 2017-06-05 11:10 +0200
  Re: [PATCH 00/21] liblockdep fixes for v4.12 Ingo Molnar <mingo@kernel.org> - 2017-05-26 09:00 +0200
    Re: [PATCH 00/21] liblockdep fixes for v4.12 "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-26 13:00 +0200
      Re: [PATCH 00/21] liblockdep fixes for v4.12 Ingo Molnar <mingo@kernel.org> - 2017-05-26 13:30 +0200
        Re: [PATCH 00/21] liblockdep fixes for v4.12 "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-26 13:50 +0200
          Re: [PATCH 00/21] liblockdep fixes for v4.12 Ingo Molnar <mingo@kernel.org> - 2017-05-28 11:20 +0200

csiph-web