Re: [PATCH 2/3] cma: split resrvation of fixed area into a helper function
From: Oscar Salvador
Date: Thu Jul 03 2025 - 05:34:27 EST
On Wed, Jul 02, 2025 at 08:36:04PM +0300, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)" <rppt@xxxxxxxxxx>
>
> Move the check that verifies that reservation of fixed area does not
> cross HIGHMEM boundary and the actual memblock_resrve() call into a
> helper function.
>
> This makes code more readable and decouples logic related to
> CONFIG_HIGHMEM from the core functionality of
> __cma_declare_contiguous_nid().
>
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
Looks good to me, nit below:
Acked-by: Oscar Salvador <osalvador@xxxxxxx>
> @@ -433,10 +448,10 @@ static int __init __cma_declare_contiguous_nid(phys_addr_t *basep,
>
> /* Reserve memory */
> if (fixed) {
> - if (memblock_is_region_reserved(base, size) ||
> - memblock_reserve(base, size) < 0) {
> - return -EBUSY;
> - }
> + int err = cma_fixed_reserve(base, size);
There's no need for 'err', you can use the already declared 'ret'.
--
Oscar Salvador
SUSE Labs