public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
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 <gang.chen.5i5j@gmail.com>
Subject: Re: [PATCH] include/linux/list_bl.h: Use bool instead of int for boolean functions
Date: Thu, 28 Jan 2016 08:22:36 +0100	[thread overview]
Message-ID: <20160128072236.GA5067@osiris> (raw)
In-Reply-To: <1453669098-8595-1-git-send-email-chengang@emindsoft.com.cn>

On Mon, Jan 25, 2016 at 04:58:18AM +0800, chengang@emindsoft.com.cn wrote:
> From: Chen Gang <chengang@emindsoft.com.cn>
> 
> hlist_bl_unhashed() and hlist_bl_empty() are all boolean functions, so
> return bool instead of int.
> 
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
>  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.

  reply	other threads:[~2016-01-28  7:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-24 20:58 [PATCH] include/linux/list_bl.h: Use bool instead of int for boolean functions chengang
2016-01-28  7:22 ` Heiko Carstens [this message]
2016-01-28 15:24   ` Chen Gang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160128072236.GA5067@osiris \
    --to=heiko.carstens@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=chengang@emindsoft.com.cn \
    --cc=dhowells@redhat.com \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox