mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Levin, Alexander" <alexander.levin@verizon.com>
To: "mingo@redhat.com" <mingo@redhat.com>,
	"peterz@infradead.org" <peterz@infradead.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ben Hutchings <ben@decadent.org.uk>,
	"Levin, Alexander" <alexander.levin@verizon.com>
Subject: [PATCH 6/8] liblockdep: Fix 'set but not used' warnings
Date: Fri, 29 Jul 2016 23:02:14 -0400	[thread overview]
Message-ID: <1469847222-21313-7-git-send-email-alexander.levin@verizon.com> (raw)
In-Reply-To: <1469847222-21313-1-git-send-email-alexander.levin@verizon.com>

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 <alexander.levin@verizon.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 6cc296f..df77669 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.7.4

  parent reply	other threads:[~2016-07-30  3:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-30  3:02 [PATCH resend 0/8] liblockdep fixes for 3.8 Levin, Alexander
2016-07-30  3:02 ` [PATCH 1/8] liblockdep: Fix undefined symbol prandom_u32 Levin, Alexander
2016-07-30  3:02 ` [PATCH 3/8] liblockdep: Define the ARRAY_SIZE() macro Levin, Alexander
2016-07-30  3:02 ` [PATCH 2/8] liblockdep: Reduce MAX_LOCK_DEPTH to avoid overflowing lock_chain::depth Levin, Alexander
2016-07-30  3:02 ` [PATCH 4/8] liblockdep: Enable -Wall by default Levin, Alexander
2016-07-30  3:02 ` [PATCH 7/8] liblockdep: Fix 'defined but not used' warning for init_utsname() Levin, Alexander
2016-07-30  3:02 ` Levin, Alexander [this message]
2016-07-30  3:02 ` [PATCH 5/8] liblockdep: Fix 'unused value' warnings Levin, Alexander
2016-07-30  3:02 ` [PATCH 8/8] liblockdep: Remove -lpthread compiler option Levin, Alexander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469847222-21313-7-git-send-email-alexander.levin@verizon.com \
    --to=alexander.levin@verizon.com \
    --cc=ben@decadent.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®