From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 9F11336AB72 for ; Sun, 21 Jun 2026 14:42:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782052939; cv=none; b=ircDiRew/hhZpNBbwjWMFcmOz0gCKx45d0WRjRgyQ+9jNlzm2eBY9ZSfAQc7+DKLVTbMoLijfGL45czsn/HahSuhejVRUMuWY/0ZRyzkU/MF7urogN+hMzKfNdZinqsHZAkwb8G+Hr7q1EwcrEQCjAfINhtdOkZjjCTB7lyvQnA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782052939; c=relaxed/simple; bh=oUjeIbd+7n3Fe4heI5qGqDD+6chi9+3Sfe0U2s9lRIk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pALO6djty2syBiNC7tj0rGsac3nv1tyr+ONKZFTVFeixmI4vaveXb1JEMj+eC7g64EQ49oAVL9O3MZkXgKPJdBkJBOg2VPa/Vw/ORjbWPcgzds9/Up2mNQY54TORukMYKLgNT6rn4CZJLOnJlgpzJAv2shHjIUPqpxzC6HkJlgc= 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=lyCUEHDJ; arc=none smtp.client-ip=91.218.175.186 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="lyCUEHDJ" 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=1782052935; 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=AjVfR3EW3M3QnoyWTRijTIFkrBnY+XE5mo9fLld+Cow=; b=lyCUEHDJF4qnJx+bS5bID5sh7assT/GDJbXzRpJ0BEJrbzgUPzR4xCXgVFQXTjKgte4J8V cc0OzMKNZPqGj6HNllacL3AQsrBeOB0ShH4nYk4CYzHx9/tFxpQOLoCCnmlgzoGykpoNAY VfORq7aGTWVkxnPFXYl//euh9d7ANcU= 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 2/4] x86/boot/compressed: Clean up EFI RSDP lookup in efi_get_rsdp_addr() Date: Sun, 21 Jun 2026 16:41:19 +0200 Message-ID: <20260621144116.224010-8-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=1766; i=thorsten.blum@linux.dev; h=from:subject; bh=oUjeIbd+7n3Fe4heI5qGqDD+6chi9+3Sfe0U2s9lRIk=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFnmP3gjvib2RvAxz2Aw2W89W+fW3FsX/7G/vO9+54CMR elk35pbHaUsDGJcDLJiiiwPZv2Y4VtaU7nJJGInzBxWJpAhDFycAjCRzNWMDNtdPrsnNC7/5bVm QqpfZpP57vpd2zduD3r/+7ZUt+xvYX2GvwLnapJZeDUbfF2ZlJYY9s7cZHzz0v03F43efr+7YWV eJi8A X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Remove the unused ret variable in __efi_get_rsdp_addr() and the unused nr_tables variable in efi_get_rsdp_addr(). Also 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 | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c index f196b1d1ddf8..92c239d8f40b 100644 --- a/arch/x86/boot/compressed/acpi.c +++ b/arch/x86/boot/compressed/acpi.c @@ -26,7 +26,6 @@ __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);