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 <[email protected]>
---
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;

Reply via email to