[PATCH v3 02/17] x86/efi: Drop redundant EFI_PARAVIRT check

Ard Biesheuvel
2026-04-23T15:21:02Z

efi_memblock_x86_reserve_range() exits early if EFI_PARAVIRT is set, so
there is no point in checking it a second time further down.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/x86/platform/efi/efi.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 0c39adb96b91..1b7a0cd54d08 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -211,11 +211,9 @@ int __init efi_memblock_x86_reserve_range(void)
data.desc_size = e->efi_memdesc_size;
data.desc_version = e->efi_memdesc_version;

- if (!efi_enabled(EFI_PARAVIRT)) {
- rv = efi_memmap_init_early(&data);
- if (rv)
- return rv;
- }
+ rv = efi_memmap_init_early(&data);
+ if (rv)
+ return rv;

if (add_efi_memmap || do_efi_soft_reserve())
do_add_efi_memmap();