[U-Boot] [PATCH v2 6/7] efi_loader: Treat the result of efi_add_memory_map as efi_status_t

Bryan O'Donoghue pure.logic at nexus-software.ie
Sun Jul 14 22:29:30 UTC 2019


The return type of efi_add_memory_map() has been updated to return
efi_status_t as a result we should check the return of efi_add_memory_map()
against EFI_SUCCESS as opposed to the original input addr parameter.

This change will also remove this error message on raspberrypi 3 boot: "FDT
memrsv map 0: Failed to add to map".

Fixes: 416e07e2cfcf ("efi: Drop error return in efi_carve_out_dt_rsv()")
Cc: Heinrich Schuchardt <xypron.glpk at gmx.de>
Cc: Alexander Graf <agraf at csgraf.de>
Signed-off-by: Bryan O'Donoghue <pure.logic at nexus-software.ie>
---
 cmd/bootefi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index c19256e00d..04d3e3e4a7 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -169,8 +169,8 @@ static void efi_carve_out_dt_rsv(void *fdt)
 
 		pages = efi_size_in_pages(size + (addr & EFI_PAGE_MASK));
 		addr &= ~EFI_PAGE_MASK;
-		if (!efi_add_memory_map(addr, pages, EFI_RESERVED_MEMORY_TYPE,
-					false))
+		if (efi_add_memory_map(addr, pages, EFI_RESERVED_MEMORY_TYPE,
+				       false) != EFI_SUCCESS)
 			printf("FDT memrsv map %d: Failed to add to map\n", i);
 	}
 }
-- 
2.22.0



More information about the U-Boot mailing list