[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1464534527.14627.9.camel@perches.com>
Date: Sun, 29 May 2016 08:08:47 -0700
From: Joe Perches <joe@...ches.com>
To: chengang@...ndsoft.com.cn, akpm@...ux-foundation.org,
trivial@...nel.org
Cc: kuleshovmail@...il.com, tony.luck@...el.com,
tangchen@...fujitsu.com, will.deacon@....com, holt@....com,
ard.biesheuvel@...aro.org, kirill.shutemov@...ux.intel.com,
linux-kernel@...r.kernel.org, Chen Gang <gang.chen.5i5j@...il.com>
Subject: Re: [PATCH trivial] include/linux/memblock.h: Clean up code for
several trivial details
On Sun, 2016-05-29 at 22:36 +0800, chengang@...ndsoft.com.cn wrote:
> From: Chen Gang <chengang@...ndsoft.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);
> }
Powered by blists - more mailing lists