From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933354AbcE3OU6 (ORCPT ); Mon, 30 May 2016 10:20:58 -0400 Received: from out1134-209.mail.aliyun.com ([42.120.134.209]:42777 "EHLO out1134-209.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932210AbcE3OU5 (ORCPT ); Mon, 30 May 2016 10:20:57 -0400 X-Greylist: delayed 312 seconds by postgrey-1.27 at vger.kernel.org; Mon, 30 May 2016 10:20:53 EDT X-Alimail-AntiSpam: AC=CONTINUE;BC=0.09688936|-1;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03312;MF=chengang@emindsoft.com.cn;NM=1;PH=DS;RN=12;RT=12;SR=0;TI=SMTPD_----4s3qTUf_1464617712; Message-ID: <574C4C4F.8080609@emindsoft.com.cn> Date: Mon, 30 May 2016 22:21:03 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Joe Perches , 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 Subject: Re: [PATCH trivial] include/linux/memblock.h: Clean up code for several trivial details References: <1464532567-6353-1-git-send-email-chengang@emindsoft.com.cn> <1464534527.14627.9.camel@perches.com> In-Reply-To: <1464534527.14627.9.camel@perches.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/29/16 23:08, Joe Perches wrote: > On Sun, 2016-05-29 at 22:36 +0800, chengang@emindsoft.com.cn wrote: >> >> 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. > No, they are not necessary. But for me, it will be more clearer, since in our kernel (at least in include/linux/), almost all Boolean functions use Boolean value or expression for return (and "!!" are often used). Please help check, and welcome any additional ideas, suggestions, and completions. Thanks. -- Chen Gang (陈刚) Managing Natural Environments is the Duty of Human Beings.