Re: [Patch v2 3/8] mm/memblock: fix comment for memblock_isolate_range()

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

 



On Thu, Apr 25, 2024 at 07:19:24AM +0000, Wei Yang wrote:
> The isolated range is [*@start_rgn, *@end_rgn - 1], while the comment says
> "the end region inside the range" is *@end_rgn.
> 
> Let's correct it.
> 
> Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx>
> ---
>  mm/memblock.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 98d25689cf10..5a363ef283d0 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -772,12 +772,12 @@ bool __init_memblock memblock_validate_numa_coverage(unsigned long threshold_byt
>   * @base: base of range to isolate
>   * @size: size of range to isolate
>   * @start_rgn: out parameter for the start of isolated region
> - * @end_rgn: out parameter for the end of isolated region
> + * @end_rgn: out parameter for the (end + 1) of isolated region

end can be inclusive or exclusive, please let's keep this line ...

>   *
>   * Walk @type and ensure that regions don't cross the boundaries defined by
>   * [@base, @base + @size).  Crossing regions are split at the boundaries,
>   * which may create at most two more regions.  The index of the first
> - * region inside the range is returned in *@start_rgn and end in *@end_rgn.
> + * region inside the range is returned in *@start_rgn and (end + 1) in *@end_rgn.

... and emphasise here that end is exclusive, e.g

The index of the first region inside the range is returned in *@start_rgn
and the index of the first region after the range is returned in *@end_rgn.

>   *
>   * Return:
>   * 0 on success, -errno on failure.
> -- 
> 2.34.1
> 

-- 
Sincerely yours,
Mike.




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

  Powered by Linux