From: Ard Biesheuvel <ardb@kernel.org>
Date: Mon, 20 Jan 2020 18:35:17 +0100
Subject: efi/x86: Merge assignments of efi.runtime_version
Patch-mainline: v5.7-rc1
Git-commit: 09308012d8546dda75e96c02bed19e2ba1e875fd
References: jsc#SLE-16407
efi.runtime_version is always set to the same value on both
existing code paths, so just set it earlier from a shared one.
Tested-by: Tony Luck <tony.luck@intel.com> # arch/ia64
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Lee, Chun-Yi <jlee@suse.com>
---
arch/x86/platform/efi/efi.c | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -421,6 +421,8 @@ static int __init efi_systab_init(u64 ph
efi_systab.tables = systab32->tables;
}
+ efi.runtime_version = hdr->revision;
+
efi_systab_report_header(hdr, efi_systab.fw_vendor);
early_memunmap(p, size);
@@ -871,15 +873,6 @@ static void __init kexec_enter_virtual_m
}
efi_sync_low_kernel_mappings();
-
- /*
- * Now that EFI is in virtual mode, update the function
- * pointers in the runtime service table to the new virtual addresses.
- *
- * Call EFI services through wrapper functions.
- */
- efi.runtime_version = efi_systab.hdr.revision;
-
efi_native_runtime_setup();
#endif
}
@@ -967,14 +960,6 @@ static void __init __efi_enter_virtual_m
efi_check_for_embedded_firmwares();
efi_free_boot_services();
- /*
- * Now that EFI is in virtual mode, update the function
- * pointers in the runtime service table to the new virtual addresses.
- *
- * Call EFI services through wrapper functions.
- */
- efi.runtime_version = efi_systab.hdr.revision;
-
if (!efi_is_mixed())
efi_native_runtime_setup();
else