From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751473AbdAPNeD (ORCPT ); Mon, 16 Jan 2017 08:34:03 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35730 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751212AbdAPNeB (ORCPT ); Mon, 16 Jan 2017 08:34:01 -0500 MIME-Version: 1.0 In-Reply-To: <20170116110622.3870494-1-arnd@arndb.de> References: <20170116110622.3870494-1-arnd@arndb.de> From: Ilya Dryomov Date: Mon, 16 Jan 2017 14:33:59 +0100 Message-ID: Subject: Re: [PATCH] ceph: use BUG() instead of BUG_ON(1) To: Arnd Bergmann Cc: "Yan, Zheng" , Sage Weil , Ceph Development , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 16, 2017 at 12:06 PM, Arnd Bergmann wrote: > 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 > --- > include/linux/ceph/osdmap.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h > index 9a9041784dcf..412906609954 100644 > --- a/include/linux/ceph/osdmap.h > +++ b/include/linux/ceph/osdmap.h > @@ -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