Re: [PATCH 1/2] mm/hugetlb: change hugetlb_reserve_pages() to type bool

From: Matthew Wilcox
Date: Mon Dec 21 2020 - 14:39:14 EST


On Mon, Dec 21, 2020 at 11:25:41AM -0800, Mike Kravetz wrote:
> While reviewing a bug in hugetlb_reserve_pages, it was noticed that all
> callers ignore the return value. Any failure is considered an ENOMEM
> error by the callers.
>
> Change the function to be of type bool. The function will return true
> if the reservation was successful, false otherwise. Callers currently
> assume a zero return code indicates success. Change the callers to look
> for true to indicate success. No functional change, only code cleanup.
>
> Signed-off-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx>

Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>