From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754768AbcA1HWu (ORCPT ); Thu, 28 Jan 2016 02:22:50 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:60305 "EHLO e06smtp13.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751668AbcA1HWp (ORCPT ); Thu, 28 Jan 2016 02:22:45 -0500 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: heiko.carstens@de.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Thu, 28 Jan 2016 08:22:36 +0100 From: Heiko Carstens To: chengang@emindsoft.com.cn Cc: akpm@linux-foundation.org, dhowells@redhat.com, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, josh@joshtriplett.org, Chen Gang Subject: Re: [PATCH] include/linux/list_bl.h: Use bool instead of int for boolean functions Message-ID: <20160128072236.GA5067@osiris> References: <1453669098-8595-1-git-send-email-chengang@emindsoft.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1453669098-8595-1-git-send-email-chengang@emindsoft.com.cn> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16012807-0013-0000-0000-0000086F2EEA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 25, 2016 at 04:58:18AM +0800, chengang@emindsoft.com.cn wrote: > From: Chen Gang > > hlist_bl_unhashed() and hlist_bl_empty() are all boolean functions, so > return bool instead of int. > > Signed-off-by: Chen Gang > --- > include/linux/list_bl.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h > index ee7229a..cb48330 100644 > --- a/include/linux/list_bl.h > +++ b/include/linux/list_bl.h > @@ -48,7 +48,7 @@ static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) > > #define hlist_bl_entry(ptr, type, member) container_of(ptr,type,member) > > -static inline int hlist_bl_unhashed(const struct hlist_bl_node *h) > +static inline bool hlist_bl_unhashed(const struct hlist_bl_node *h) > { > return !h->pprev; > } > @@ -68,7 +68,7 @@ static inline void hlist_bl_set_first(struct hlist_bl_head *h, > h->first = (struct hlist_bl_node *)((unsigned long)n | LIST_BL_LOCKMASK); > } > > -static inline int hlist_bl_empty(const struct hlist_bl_head *h) > +static inline bool hlist_bl_empty(const struct hlist_bl_head *h) > { > return !((unsigned long)READ_ONCE(h->first) & ~LIST_BL_LOCKMASK); Sorry for my ignorance, but what's the point of doing conversions like this? It has zero impact on code generation.