[PATCH 4.10 68/75] libceph: use BUG() instead of BUG_ON(1)

From: Greg Kroah-Hartman
Date: Mon Mar 13 2017 - 04:49:10 EST

4.10-stable review patch. If anyone has any objections, please let me know.


From: Arnd Bergmann <arnd@xxxxxxxx>

commit d24cdcd3e40a6825135498e11c20c7976b9bf545 upstream.

I ran into this compile warning, which is the result of BUG_ON(1)
not always leading to the compiler treating the code path as

include/linux/ceph/osdmap.h: In function 'ceph_can_shift_osds':
include/linux/ceph/osdmap.h:62:1: error: control reaches end of non-void function [-Werror=return-type]

Using BUG() here avoids the warning.

Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Signed-off-by: Ilya Dryomov <idryomov@xxxxxxxxx>
Cc: Heinrich Schuchardt <xypron.glpk@xxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

include/linux/ceph/osdmap.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -57,7 +57,7 @@ static inline bool ceph_can_shift_osds(s
return false;
- BUG_ON(1);
+ BUG();