diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-10-15 02:33:33 +0200 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-10-21 03:46:04 +0200 |
commit | 9ad37fe405a6fccba3555892ac9e64dbd37b0581 (patch) | |
tree | ef855bfa969d20f9d9fcd6760a7fc85233d46629 /lib | |
parent | 05345425cab4202b356085afcac485614a9b52a9 (diff) | |
download | u-boot-9ad37fe405a6fccba3555892ac9e64dbd37b0581.zip u-boot-9ad37fe405a6fccba3555892ac9e64dbd37b0581.tar.gz u-boot-9ad37fe405a6fccba3555892ac9e64dbd37b0581.tar.bz2 |
efi_loader: avoid multiple local copies of lf2_initrd_guid
Create the GUID as a global variable.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_helper.c | 5 | ||||
-rw-r--r-- | lib/efi_loader/efi_load_initrd.c | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c index 89833de..485384b 100644 --- a/lib/efi_loader/efi_helper.c +++ b/lib/efi_loader/efi_helper.c @@ -13,6 +13,11 @@ #include <efi_loader.h> #include <efi_variable.h> +#if defined(CONFIG_CMD_EFIDEBUG) || defined(CONFIG_EFI_LOAD_FILE2_INITRD) +/* GUID used by Linux to identify the LoadFile2 protocol with the initrd */ +const efi_guid_t efi_lf2_initrd_guid = EFI_INITRD_MEDIA_GUID; +#endif + /** * efi_create_current_boot_var() - Return Boot#### name were #### is replaced by * the value of BootCurrent diff --git a/lib/efi_loader/efi_load_initrd.c b/lib/efi_loader/efi_load_initrd.c index e2a8063..c5e6652 100644 --- a/lib/efi_loader/efi_load_initrd.c +++ b/lib/efi_loader/efi_load_initrd.c @@ -52,7 +52,6 @@ static efi_handle_t efi_initrd_handle; */ static efi_status_t get_initrd_fp(struct efi_device_path **initrd_fp) { - const efi_guid_t lf2_initrd_guid = EFI_INITRD_MEDIA_GUID; struct efi_device_path *dp = NULL; /* @@ -65,7 +64,7 @@ static efi_status_t get_initrd_fp(struct efi_device_path **initrd_fp) * We can then use this specific return value and not install the * protocol, while allowing the boot to continue */ - dp = efi_get_dp_from_boot(lf2_initrd_guid); + dp = efi_get_dp_from_boot(efi_lf2_initrd_guid); if (!dp) return EFI_INVALID_PARAMETER; |