lkml.org 
[lkml]   [2014]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] bug: Add unreachable() to generic BUG() to silence warnings
Date
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


\
 
 \ /
  Last update: 2014-08-07 03:21    [W:0.045 / U:4.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site