lkml.org 
[lkml]   [2020]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 04/10] mm/hugetlb: count file_region to be added when regions_needed != NULL
From
Date
On 8/7/20 2:12 AM, Wei Yang wrote:
> There are only two cases of function add_reservation_in_range()
>
> * count file_region and return the number in regions_needed
> * do the real list operation without counting
>
> This means it is not necessary to have two parameters to classify these
> two cases.
>
> Just use regions_needed to separate them.
>
> Signed-off-by: Wei Yang <richard.weiyang@linux.alibaba.com>

Thanks!

I really like removal of the 'count_only' parameter. However, within the
routine 'count_only' made the code just a little easier to understand. I
might have:
- Removed the function parameter.
- Added local variable
bool count_only = regions_needed != NULL;
- Left remaining code as it.

I'm OK with the proposed change. Any change to readability is VERY minimal.

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>

--
Mike Kravetz

\
 
 \ /
  Last update: 2020-08-10 23:47    [W:0.362 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site