]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
libceph: use BUG() instead of BUG_ON(1)
authorArnd Bergmann <arnd@arndb.de>
Mon, 16 Jan 2017 11:06:09 +0000 (12:06 +0100)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 15 Mar 2017 15:32:11 +0000 (10:32 -0500)
BugLink: http://bugs.launchpad.net/bugs/1673118
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
unreachable:

    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@arndb.de>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
include/linux/ceph/osdmap.h

index 9a9041784dcff383169a169c39203dd79f383438..4129066099541ba36bf9e53c9e69235d8095d14f 100644 (file)
@@ -57,7 +57,7 @@ static inline bool ceph_can_shift_osds(struct ceph_pg_pool_info *pool)
        case CEPH_POOL_TYPE_EC:
                return false;
        default:
-               BUG_ON(1);
+               BUG();
        }
 }