From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/3] linux/barebox-wrapper: Silence gcc5 warning
Date: Thu, 10 Dec 2015 11:07:25 +0100 [thread overview]
Message-ID: <1449742046-20906-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1449742046-20906-1-git-send-email-s.hauer@pengutronix.de>
gcc5 warns about using flags uninitialized in spin_lock_irqsave,
although it could look into the static inline spin_lock_irqsave
implementation and see it's not used at all. An empty define instead
of the static inline wrapper would lead to a "unused variable" warning.
Let's create a macro and fake some usage of the flags variable. This
probably helps until gcc6 is out.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
include/linux/barebox-wrapper.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/barebox-wrapper.h b/include/linux/barebox-wrapper.h
index 3859185..5fe7971 100644
--- a/include/linux/barebox-wrapper.h
+++ b/include/linux/barebox-wrapper.h
@@ -39,8 +39,8 @@ typedef int spinlock_t;
#define spin_lock_init(...)
#define spin_lock(...)
#define spin_unlock(...)
-static inline void spin_lock_irqsave(spinlock_t *lock, unsigned long flags) {}
-static inline void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) {}
+#define spin_lock_irqsave(lock, flags) do { flags = 0; } while (0)
+#define spin_unlock_irqrestore(lock, flags) do { flags = flags; } while (0)
#define mutex_init(...)
#define mutex_lock(...)
--
2.6.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-12-10 10:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 10:07 Fix some gcc5 warnings Sascha Hauer
2015-12-10 10:07 ` [PATCH 1/3] ubiformat: fix the subpage size hint on the error path Sascha Hauer
2015-12-10 10:07 ` Sascha Hauer [this message]
2015-12-10 19:23 ` [PATCH 2/3] linux/barebox-wrapper: Silence gcc5 warning Trent Piepho
2015-12-11 7:12 ` Sascha Hauer
2015-12-10 10:07 ` [PATCH 3/3] ARM: Omap3: Remove useless inline Sascha Hauer
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=1449742046-20906-3-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.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