From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 CDADC279917 for ; Wed, 24 Jun 2026 12:03:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782302615; cv=none; b=Um8zzpCkdM/w/2zaWw6jAXkDkegjXXqKMIxhQR9EORd0P9Zio/a8YkObXAR3N7IUmVYp8xGFgeE8sF+ytDnaRmkLXBoJ+aZb0Lh7VwtMUlebtWbskAmBg0EsOtEKgdCngdkEaXeVdgLmtFcqMyNnIj5XXmXlG0oQWmIc1uAuQQo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782302615; c=relaxed/simple; bh=cGiPnxkTAWV/sRJEZe5m9MvY1YBHRmIkBnVtF5o637Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QsgkbpsSqj+jWuTXH/FZ7H4epnlfoQc9pEOdi1lK7f+ITe6MGxwHzBF/BBcOOknMtYQxof1cZSA+pZ39Npie0t/9u+/bELKtkebKA2HzLQXEXLCSemnITuuMMFIp7uXlQkew1SKICK6u/l8Gf3d5b09Gh4rTm4Qjf1bUG/+giD4= 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=qzpT34yY; arc=none smtp.client-ip=91.218.175.183 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="qzpT34yY" 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=1782302611; 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=0QvCmnyvicTVywrR9L/lUDEsd0opEgwdo/4BwdhYjCg=; b=qzpT34yYOenItewANflQHBNOk4wnlEVgLbHQCV+IJX12pWd3aPw9YM9evnIG47+69psV4e e+Q8hV7symrR7m7cWbIJgKfu9yKfxFAQCs0YPs9hSs4ypFyV93IAEfEuXpnRuGnRGbcs4i Lj+I2bOyW4OaOcB7aRLTL7F5dLn3gSQ= 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 v2 2/4] x86/boot/compressed: Clean up EFI RSDP lookup in efi_get_rsdp_addr() Date: Wed, 24 Jun 2026 14:02:56 +0200 Message-ID: <20260624120300.590233-8-thorsten.blum@linux.dev> In-Reply-To: <20260624120300.590233-6-thorsten.blum@linux.dev> References: <20260624120300.590233-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=1936; i=thorsten.blum@linux.dev; h=from:subject; bh=cGiPnxkTAWV/sRJEZe5m9MvY1YBHRmIkBnVtF5o637Q=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFnWx+tKdt+zTL7e2vdnHZP2Ap4K3eNMG94/eyC6J50vh 0nw6oddHSUsDGJcDLJiiiwPZv2Y4VtaU7nJJGInzBxWJpAhDFycAjARh+8MP6Y4vbhcfS/h+for RTrWihrPLY43Gm/5X3yK+9u3awoa9owMKxmjt06KdhE2v3/FUYuzQPKrffNB7VnWv7ulD22WXzu FFwA= X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Mark __efi_get_rsdp_addr() as __maybe_unused and remove the unused ret variable. In efi_get_rsdp_addr(), remove the unused nr_tables variable and inline variables that are only used for simple if checks. Since efi_get_conf_table() already calls efi_get_system_table(), drop the redundant efi_get_system_table() call and keep a single error path. Signed-off-by: Thorsten Blum --- arch/x86/boot/compressed/acpi.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c index f196b1d1ddf8..c6e1db48229c 100644 --- a/arch/x86/boot/compressed/acpi.c +++ b/arch/x86/boot/compressed/acpi.c @@ -21,12 +21,11 @@ */ struct mem_vector immovable_mem[MAX_NUMNODES*2]; -static acpi_physical_address +static acpi_physical_address __maybe_unused __efi_get_rsdp_addr(unsigned long cfg_tbl_pa, unsigned int cfg_tbl_len) { #ifdef CONFIG_EFI unsigned long rsdp_addr; - int ret; /* * Search EFI system tables for RSDP. Preferred is ACPI_20_TABLE_GUID to @@ -53,21 +52,12 @@ static acpi_physical_address efi_get_rsdp_addr(void) #ifdef CONFIG_EFI unsigned long cfg_tbl_pa = 0; unsigned int cfg_tbl_len; - unsigned long systab_pa; - unsigned int nr_tables; - enum efi_type et; - int ret; - et = efi_get_type(boot_params_ptr); - if (et == EFI_TYPE_NONE) + if (efi_get_type(boot_params_ptr) == EFI_TYPE_NONE) return 0; - systab_pa = efi_get_system_table(boot_params_ptr); - if (!systab_pa) - error("EFI support advertised, but unable to locate system table."); - - ret = efi_get_conf_table(boot_params_ptr, &cfg_tbl_pa, &cfg_tbl_len); - if (ret || !cfg_tbl_pa) + if (efi_get_conf_table(boot_params_ptr, &cfg_tbl_pa, &cfg_tbl_len) || + !cfg_tbl_pa) error("EFI config table not found."); return __efi_get_rsdp_addr(cfg_tbl_pa, cfg_tbl_len);