[PATCH v4 1/4] x86/boot/compressed: Remove unused variables in EFI helpers

From: Thorsten Blum

Date: Mon Nov 09 2026 - 07:56:25 EST


efi_get_system_table() declares an unused et variable, and
efi_get_conf_table() declares an unused ret variable - remove both.

get_kexec_setup_data() also takes an unused et argument. Drop the
argument and update the only caller in efi_get_conf_table().

Also simplify the no EFI system table case in efi_get_system_table() by
falling through to the existing return since sys_tbl_pa is already zero,
and add the missing newline to the debug log message.

Reviewed-by: Jan Stancek <jstancek@xxxxxxxxxx>
Reviewed-by: Nicolas Schier <n.schier@xxxxxxxxx>
Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
---
arch/x86/boot/compressed/efi.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/arch/x86/boot/compressed/efi.c b/arch/x86/boot/compressed/efi.c
index f2e50f9758e6..f2d08e756e66 100644
--- a/arch/x86/boot/compressed/efi.c
+++ b/arch/x86/boot/compressed/efi.c
@@ -61,7 +61,6 @@ unsigned long efi_get_system_table(struct boot_params *bp)
{
unsigned long sys_tbl_pa;
struct efi_info *ei;
- enum efi_type et;

/* Get systab from boot params. */
ei = &bp->efi_info;
@@ -70,10 +69,8 @@ unsigned long efi_get_system_table(struct boot_params *bp)
#else
sys_tbl_pa = ei->efi_systab;
#endif
- if (!sys_tbl_pa) {
- debug_putstr("EFI system table not found.");
- return 0;
- }
+ if (!sys_tbl_pa)
+ debug_putstr("EFI system table not found.\n");

return sys_tbl_pa;
}
@@ -84,11 +81,10 @@ unsigned long efi_get_system_table(struct boot_params *bp)
* the initial physical address via a struct setup_data entry, which is
* checked for here, along with some sanity checks.
*/
-static struct efi_setup_data *get_kexec_setup_data(struct boot_params *bp,
- enum efi_type et)
+static struct efi_setup_data *get_kexec_setup_data(struct boot_params *bp)
{
-#ifdef CONFIG_X86_64
struct efi_setup_data *esd = NULL;
+#ifdef CONFIG_X86_64
struct setup_data *data;
u64 pa_data;

@@ -112,10 +108,8 @@ static struct efi_setup_data *get_kexec_setup_data(struct boot_params *bp,
debug_putstr("kexec EFI environment missing valid configuration table.\n");
return NULL;
}
-
- return esd;
#endif
- return NULL;
+ return esd;
}

/**
@@ -133,7 +127,6 @@ int efi_get_conf_table(struct boot_params *bp, unsigned long *cfg_tbl_pa,
{
unsigned long sys_tbl_pa;
enum efi_type et;
- int ret;

if (!cfg_tbl_pa || !cfg_tbl_len)
return -EINVAL;
@@ -149,7 +142,7 @@ int efi_get_conf_table(struct boot_params *bp, unsigned long *cfg_tbl_pa,
struct efi_setup_data *esd;

/* kexec provides an alternative EFI conf table, check for it. */
- esd = get_kexec_setup_data(bp, et);
+ esd = get_kexec_setup_data(bp);

*cfg_tbl_pa = esd ? esd->tables : stbl->tables;
*cfg_tbl_len = stbl->nr_tables;