[PATCH 22/30] efi: make efi_main __noreturn

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Nov 22 00:47:24 PST 2021


The function never returns, so mark it as such.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 common/efi/payload/init.c | 6 +-----
 include/efi.h             | 2 ++
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/common/efi/payload/init.c b/common/efi/payload/init.c
index e1f968117a01..d8a43e88856c 100644
--- a/common/efi/payload/init.c
+++ b/common/efi/payload/init.c
@@ -221,12 +221,10 @@ static int efi_init(void)
 }
 device_initcall(efi_init);
 
-asmlinkage efi_status_t efi_main(efi_handle_t, efi_system_table_t *);
-
 /**
  * efi-main - Entry point for EFI images
  */
-efi_status_t efi_main(efi_handle_t image, efi_system_table_t *sys_table)
+void efi_main(efi_handle_t image, efi_system_table_t *sys_table)
 {
 	efi_physical_addr_t mem;
 	size_t memsize;
@@ -266,8 +264,6 @@ efi_status_t efi_main(efi_handle_t image, efi_system_table_t *sys_table)
 	mem_malloc_init((void *)mem, (void *)mem + memsize - 1);
 
 	start_barebox();
-
-	return EFI_SUCCESS;
 }
 
 static int efi_core_init(void)
diff --git a/include/efi.h b/include/efi.h
index 36452d296dd4..51382f5bfea0 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -591,6 +591,8 @@ efi_guidcmp (efi_guid_t left, efi_guid_t right)
 	return memcmp(&left, &right, sizeof (efi_guid_t));
 }
 
+__attribute__((noreturn)) void efi_main(efi_handle_t, efi_system_table_t *);
+
 /*
  * Variable Attributes
  */
-- 
2.30.2




More information about the barebox mailing list