From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EF5436A008 for ; Sun, 21 Jun 2026 14:42:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782052938; cv=none; b=CZReGGpg7ME3yQYZ4mddgVmbMuZoezewIvEJSwaapOHuEWeBZyDC8mnY1P4eVDWP3S5kJnGxygAbtKLUKr+9+yjmUQ+6Q4GogCRL2c8tPSfEn71SgLt69BUVzr4CSPjh152eAKtv3mZxloZPENgwy2/6molcQJ3bK5jeqIEkavo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782052938; c=relaxed/simple; bh=cPmk7MfhsJaUCdH4iHiguMSHG4LacvgiGEkUseJVcxI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KY4UsiqDOeEmNP3S6sRTzObs9gFOvcb6a7HgTY0C6Usa4VfHvN3qjE9A/ycQCov/xaXQlKv07Zerl7lGTohSGxsyFCUf2xwkjAgTMi9mDZ0gMUeJl7j2DIkN7TubbRRpD13jkkJf8DQzVNyTyhKkAJkYZ520UCV46r29MQlTEbA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=wFWMDDqX; arc=none smtp.client-ip=91.218.175.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="wFWMDDqX" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1782052934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i7R5kqkFaW5FefjgfAMLaj/A57n/I9+HmxfOtSA65RA=; b=wFWMDDqXA834quD/T9KJ7FJHOTlB9qZ4JwmCFZQgBVj5onIezEi2IO77tg35QzW7fDz1o9 MYhWEnywr201WzeRyC2GsEyqsLFrIFKV89suJgbkSGY4FUcXN77rCm5TkdhnJlyESeHWGD CeqhmFBI4KW5TY2eEvoacfwUxMlGgfM= From: Thorsten Blum To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Ard Biesheuvel , Nathan Chancellor , Nicolas Schier Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Thorsten Blum Subject: [PATCH 1/4] x86/boot/compressed: Remove unused variables in EFI helpers Date: Sun, 21 Jun 2026 16:41:18 +0200 Message-ID: <20260621144116.224010-7-thorsten.blum@linux.dev> In-Reply-To: <20260621144116.224010-6-thorsten.blum@linux.dev> References: <20260621144116.224010-6-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2674; i=thorsten.blum@linux.dev; h=from:subject; bh=cPmk7MfhsJaUCdH4iHiguMSHG4LacvgiGEkUseJVcxI=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFnmP3iNjb7m/BPfxFSsd3HJ+rnsqWZKLoEFgkYr1D4+L fua9X9dRykLgxgXg6yYIsuDWT9m+JbWVG4yidgJM4eVCWQIAxenAExEq5GR4eSG7SWpcx3dNJ5s XLxAf0dbfeSSS/dLHp3efmrDw9/3Q4QZGV5Pf3kk/VAqy+3QFLuHDu63JXdwsl60tDV7+jYt2NX rCjcA X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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 --- 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;