Re: [PATCH v2] mm: page-flags: Use bool return value instead of int for all XXPageXXX functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/26/16 15:30, Vlastimil Babka wrote:
> On 07/24/2016 06:56 AM, chengang@xxxxxxxxxxxxxxxx wrote:
>> From: Chen Gang <gang.chen.5i5j@xxxxxxxxx>
>>
>> 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 (陈刚)

Managing Natural Environments is the Duty of Human Beings.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]