From: Nick Krause <xerofoiify@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>,
"open list:GENERIC INCLUDE/A..." <linux-arch@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Cc: josh@joshtriplett.org
Subject: [PATCH 1/1] bug: Add unreachable() to generic BUG() to silence warnings
Date: Thu, 7 Aug 2014 03:13:41 +0200 [thread overview]
Message-ID: <1407374021-20682-1-git-send-email-xerofoiify@gmail.com> (raw)
Architectures which use generic BUG() have warnings like
kernel/sched/core.c:2692:1: warning: control reaches end of non-void function [-Wreturn-type]
net/core/ethtool.c:236:1: warning: control reaches end of non-void function [-Wreturn-type]
Other BUG() implementations
have added unreachable() at end but generic does not. I guess
that is why
it showing these errors. We can silence them using unreachable().
Signed-off-by: Nick Krause <xerofoify@gmail.com>
---
include/asm-generic/bug.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 630dd23..effcc82 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -48,6 +48,7 @@ struct bug_entry {
#define BUG() do { \
printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
panic("BUG!"); \
+ unreachable(); \
} while (0)
#endif
--
2.0.1
next reply other threads:[~2014-08-07 1:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-07 1:13 Nick Krause [this message]
2014-08-07 5:06 ` [PATCH 1/1] bug: Add unreachable() to generic BUG() to silence warnings Josh Triplett
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=1407374021-20682-1-git-send-email-xerofoiify@gmail.com \
--to=xerofoiify@gmail.com \
--cc=arnd@arndb.de \
--cc=josh@joshtriplett.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).