ceph: use BUG() instead of BUG_ON(1)
PATCH 1/1 ceph: use BUG() instead of BUG_ON(1)
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.
--- include/linux/ceph/osdmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/ceph/osdmap.h +1 -1
@@ -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 (); } }
Signature · 1 line
2.9.0
Quoted 19 lines · Arnd Bergmann
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 <[email protected]>--- include/linux/ceph/osdmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/ceph/osdmap.h +0
-0
include/linux/ceph/osdmap.h static inline bool ceph_can_shift_osds(struct ceph_pg_pool_info *pool) · line 62
Quoted 7 lines
include/linux/ceph/osdmap.h +1
-1@@ -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 (); } }
Applied.
Thanks,
Ilya