[PATCH v2 4/6] lmb: remove superfluous address overlap check from lmb_add_region_flags()

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Thu Feb 20 11:46:26 CET 2025


On 20.02.25 10:56, Sughosh Ganu wrote:
> The lmb_reserve() function now does a check for a reservation request
> with existing reserved regions, and returns -EEXIST in case of an
> overlap. Remove this now redundant check from lmb_add_region_flags().

We have numerous places where lmb_add_region_flags() is called,e.g. 
lmb_free_flags(), _lmb_alloc_base(). It is unclear to me if in all cases 
removing the check is allowable.

Could you, please, in the commit message provide an analysis for all 
callers that don't use LMB_NONE.

Best regards

Heinrich

> 
> Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> ---
> Changes since V1: New patch
> 
>   lib/lmb.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/lib/lmb.c b/lib/lmb.c
> index 45888989457..061f9a07541 100644
> --- a/lib/lmb.c
> +++ b/lib/lmb.c
> @@ -199,9 +199,6 @@ static long lmb_add_region_flags(struct alist *lmb_rgn_lst, phys_addr_t base,
>   			coalesced++;
>   			break;
>   		} else if (lmb_addrs_overlap(base, size, rgnbase, rgnsize)) {
> -			if (flags != LMB_NONE)
> -				return -EEXIST;
> -
>   			ret = lmb_resize_regions(lmb_rgn_lst, i, base, size);
>   			if (ret < 0)
>   				return -1;



More information about the U-Boot mailing list