The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nsc@kernel.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	Thorsten Blum <thorsten.blum@linux.dev>
Subject: [PATCH 1/4] x86/boot/compressed: Remove unused variables in EFI helpers
Date: Sun, 21 Jun 2026 16:41:18 +0200	[thread overview]
Message-ID: <20260621144116.224010-7-thorsten.blum@linux.dev> (raw)
In-Reply-To: <20260621144116.224010-6-thorsten.blum@linux.dev>

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

get_kexec_setup_data() also takes an efi_type argument that is not used.
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.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/x86/boot/compressed/efi.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/arch/x86/boot/compressed/efi.c b/arch/x86/boot/compressed/efi.c
index f2e50f9758e6..e0329a03618a 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) {
+	if (!sys_tbl_pa)
 		debug_putstr("EFI system table not found.");
-		return 0;
-	}
 
 	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;

  reply	other threads:[~2026-06-21 14:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-21 14:41 [PATCH 0/4] x86/boot/compressed: Enable -Wunused and remove unused variables Thorsten Blum
2026-06-21 14:41 ` Thorsten Blum [this message]
2026-06-21 14:41 ` [PATCH 2/4] x86/boot/compressed: Clean up EFI RSDP lookup in efi_get_rsdp_addr() Thorsten Blum
2026-06-21 14:41 ` [PATCH 3/4] x86/boot/compressed: Mark process_mem_region() index __maybe_unused Thorsten Blum
2026-06-21 14:41 ` [PATCH 4/4] x86/boot/compressed: Enable -Wunused Thorsten Blum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260621144116.224010-7-thorsten.blum@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox