Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41104 )
Change subject: memrange: Break early from memranges_find_entry if limit is crossed ......................................................................
memrange: Break early from memranges_find_entry if limit is crossed
This change updates memranges_find_entry() to break and return early if the end address of the hole within the current range entry crosses the requested limit. This is because all range entries and maintained in increasing order and so none of the following range entries can satisfy the given request.
Change-Id: I14e03946ddbbb5d254b23e9a9917da42960313a6 Signed-off-by: Furquan Shaikh furquan@google.com --- M src/lib/memrange.c 1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/41104/1
diff --git a/src/lib/memrange.c b/src/lib/memrange.c index 32f053d..bc827d3 100644 --- a/src/lib/memrange.c +++ b/src/lib/memrange.c @@ -400,8 +400,13 @@ if (end > r->end) continue;
+ /* + * If end for the hole in the current range entry goes beyond the requested + * limit, then none of the following ranges can satisfy this request because all + * range entries are maintained in increasing order. + */ if (end > limit) - continue; + break;
return r; }
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41104 )
Change subject: memrange: Break early from memranges_find_entry if limit is crossed ......................................................................
Patch Set 1: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/41104 )
Change subject: memrange: Break early from memranges_find_entry if limit is crossed ......................................................................
memrange: Break early from memranges_find_entry if limit is crossed
This change updates memranges_find_entry() to break and return early if the end address of the hole within the current range entry crosses the requested limit. This is because all range entries and maintained in increasing order and so none of the following range entries can satisfy the given request.
Change-Id: I14e03946ddbbb5d254b23e9a9917da42960313a6 Signed-off-by: Furquan Shaikh furquan@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/41104 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Aaron Durbin adurbin@chromium.org --- M src/lib/memrange.c 1 file changed, 6 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Aaron Durbin: Looks good to me, approved
diff --git a/src/lib/memrange.c b/src/lib/memrange.c index 32f053d..bc827d3 100644 --- a/src/lib/memrange.c +++ b/src/lib/memrange.c @@ -400,8 +400,13 @@ if (end > r->end) continue;
+ /* + * If end for the hole in the current range entry goes beyond the requested + * limit, then none of the following ranges can satisfy this request because all + * range entries are maintained in increasing order. + */ if (end > limit) - continue; + break;
return r; }