From: Chen Gang <chengang@emindsoft.com.cn>
To: Vlastimil Babka <vbabka@suse.cz>,
akpm@linux-foundation.org, minchan@kernel.org,
mgorman@techsingularity.net, mhocko@suse.com
Cc: gi-oh.kim@profitbricks.com, iamjoonsoo.kim@lge.com,
hillf.zj@alibaba-inc.com, rientjes@google.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Chen Gang <gang.chen.5i5j@gmail.com>
Subject: Re: [PATCH v2] mm: page-flags: Use bool return value instead of int for all XXPageXXX functions
Date: Thu, 28 Jul 2016 05:35:35 +0800 [thread overview]
Message-ID: <57992927.8050904@emindsoft.com.cn> (raw)
In-Reply-To: <13e3f511-e14c-2e4d-9627-4a85c65de931@suse.cz>
On 7/26/16 15:30, Vlastimil Babka wrote:
> On 07/24/2016 06:56 AM, chengang@emindsoft.com.cn wrote:
>> From: Chen Gang <gang.chen.5i5j@gmail.com>
>>
>> For pure bool function's return value, bool is a little better more or
>> less than int.
>
> That's not exactly a bulletproof justification... At least provide a scripts/bloat-o-meter output?
>
>> Under source root directory, use `grep -rn Page * | grep "\<int\>"` to
>> find the area that need be changed.
>>
>> For the related macro function definiations (e.g. TESTPAGEFLAG), they
>> use xxx_bit which should be pure bool functions, too. But under most of
>> architectures, xxx_bit are return int, which need be changed next.
>
> Sounds like a large task. And until we know the arches will agree with this, this patch will bring just inconsistency?
>
For me, for bool function, we can still return int value instead of bool,
e.g. *_test() will return int under quite a few of archs, and Page*()
use *_test(), but we need not use '!!' to cast the return value to bool.
And for me, we can still use int variable to catch the return value of
bool function, but it will be better to be improved. So in this patch, I
also modify all related areas as far as I can find.
All together, for me, in the worst case, if I really missed any areas or
any functions: it is still better to be improved, but for building and
running, it is no negative effect.
Thanks.
--
Chen Gang (e??a??)
Managing Natural Environments is the Duty of Human Beings.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2016-07-27 21:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-24 4:56 [PATCH v2] mm: page-flags: Use bool return value instead of int for all XXPageXXX functions chengang
2016-07-26 7:30 ` Vlastimil Babka
2016-07-27 21:35 ` Chen Gang [this message]
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=57992927.8050904@emindsoft.com.cn \
--to=chengang@emindsoft.com.cn \
--cc=akpm@linux-foundation.org \
--cc=gang.chen.5i5j@gmail.com \
--cc=gi-oh.kim@profitbricks.com \
--cc=hillf.zj@alibaba-inc.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=minchan@kernel.org \
--cc=rientjes@google.com \
--cc=vbabka@suse.cz \
/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;
as well as URLs for NNTP newsgroup(s).