Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39485 )
Change subject: memrange: Add a helper function to determine if memranges is empty ......................................................................
memrange: Add a helper function to determine if memranges is empty
This change adds a helper function memranges_is_empty() which returns true if there are no entries in memranges.
BUG=b:149186922
Signed-off-by: Furquan Shaikh furquan@google.com Change-Id: If841c42a9722cbc73ef321568928bc175bf88fd5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/39485 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com --- M src/include/memrange.h 1 file changed, 5 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
diff --git a/src/include/memrange.h b/src/include/memrange.h index f8fa033..ea3b118 100644 --- a/src/include/memrange.h +++ b/src/include/memrange.h @@ -81,6 +81,11 @@ r->tag = new_tag; }
+static inline bool memranges_is_empty(struct memranges *ranges) +{ + return ranges->entries == NULL; +} + /* Iterate over each entry in a memranges structure. Ranges cannot * be deleted while processing each entry as the list cannot be safely * traversed after such an operation.