public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: chengang@emindsoft.com.cn, akpm@linux-foundation.org, trivial@kernel.org
Cc: kuleshovmail@gmail.com, tony.luck@intel.com,
	tangchen@cn.fujitsu.com, will.deacon@arm.com, holt@sgi.com,
	ard.biesheuvel@linaro.org, kirill.shutemov@linux.intel.com,
	linux-kernel@vger.kernel.org,
	Chen Gang <gang.chen.5i5j@gmail.com>
Subject: Re: [PATCH trivial] include/linux/memblock.h: Clean up code for several trivial details
Date: Sun, 29 May 2016 08:08:47 -0700	[thread overview]
Message-ID: <1464534527.14627.9.camel@perches.com> (raw)
In-Reply-To: <1464532567-6353-1-git-send-email-chengang@emindsoft.com.cn>

On Sun, 2016-05-29 at 22:36 +0800, chengang@emindsoft.com.cn wrote:
> From: Chen Gang <chengang@emindsoft.com.cn>
> 
> Correct the function parameters alignment, since original code already
> use both tabs and white spaces together for the incorrect parameters
> alignment functions.
> 
> If one line can hold one statement within 80 columns, let it in one line
> (original code did not consider about the tabs/spaces for 2nd line when
> a statement is separated into 2 lines).
> 
> Use "!!" to let the boolean function return boolean value directly.
[]
> diff --git a/include/linux/memblock.h b/include/linux/memblock.h
[]
> @@ -191,12 +190,12 @@ static inline bool movable_node_is_enabled(void)
>  
>  static inline bool memblock_is_mirror(struct memblock_region *m)
>  {
> -	return m->flags & MEMBLOCK_MIRROR;
> +	return !!(m->flags & MEMBLOCK_MIRROR);

These !! uses are't necessary.
The compiler makes the bool return 0 or 1.

>  }
>  
>  static inline bool memblock_is_nomap(struct memblock_region *m)
>  {
> -	return m->flags & MEMBLOCK_NOMAP;
> +	return !!(m->flags & MEMBLOCK_NOMAP);
>  }

  reply	other threads:[~2016-05-29 15:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-29 14:36 [PATCH trivial] include/linux/memblock.h: Clean up code for several trivial details chengang
2016-05-29 15:08 ` Joe Perches [this message]
2016-05-30 14:21   ` Chen Gang
2016-05-30 14:33     ` Joe Perches
2016-05-30 22:14       ` Chen Gang
2016-05-31  2:06       ` 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=1464534527.14627.9.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=chengang@emindsoft.com.cn \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=holt@sgi.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kuleshovmail@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tangchen@cn.fujitsu.com \
    --cc=tony.luck@intel.com \
    --cc=trivial@kernel.org \
    --cc=will.deacon@arm.com \
    /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