From nobody Mon Apr 6 13:31:06 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8ABEFC433F5 for ; Tue, 11 Oct 2022 01:33:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230251AbiJKBdC (ORCPT ); Mon, 10 Oct 2022 21:33:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbiJKBcy (ORCPT ); Mon, 10 Oct 2022 21:32:54 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 919AB78BF1 for ; Mon, 10 Oct 2022 18:32:53 -0700 (PDT) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MmdVs70xTzpTKb; Tue, 11 Oct 2022 09:29:41 +0800 (CST) Received: from huawei.com (10.67.175.88) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 11 Oct 2022 09:32:50 +0800 From: Li Zetao To: , , , , , , , , , , , CC: , , , , , , , Subject: [PATCH -next v4 1/2] x86/boot: Remove unused variables Date: Tue, 11 Oct 2022 01:29:03 +0000 Message-ID: <20221011012904.2330473-2-lizetao1@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221011012904.2330473-1-lizetao1@huawei.com> References: <202210090815.526C76396@keescook> <20221011012904.2330473-1-lizetao1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.67.175.88] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Gcc report warning as follows: arch/x86/boot/compressed/efi.c: In function =E2=80=98efi_get_system_table= =E2=80=99: arch/x86/boot/compressed/efi.c:62:23: warning: unused variable =E2=80=98et= =E2=80=99 [-Wunused-variable] arch/x86/boot/compressed/efi.c: In function =E2=80=98efi_get_conf_table=E2= =80=99: arch/x86/boot/compressed/efi.c:134:13: warning: unused variable =E2=80=98ret=E2=80=99 [-Wunused-variable] arch/x86/boot/compressed/acpi.c: In function =E2=80=98__efi_get_rsdp_addr= =E2=80=99: arch/x86/boot/compressed/acpi.c:27:13: warning: unused variable =E2=80=98ret=E2=80=99 [-Wunused-variable] arch/x86/boot/compressed/acpi.c: In function =E2=80=98efi_get_rsdp_addr=E2= =80=99: arch/x86/boot/compressed/acpi.c:55:22: warning: unused variable =E2=80=98nr_tables=E2=80=99 [-Wunused-variable] arch/x86/boot/compressed/sev.c: In function =E2=80=98enforce_vmpl0=E2=80=99: arch/x86/boot/compressed/sev.c:256:13: error: unused variable =E2=80=98err= =E2=80=99 [-Werror=3Dunused-variable] Fix these warnings by removing unused variables. Fixes: 58f3e6b71f42 ("x86/compressed/acpi: Move EFI system table lookup to = helper") Fixes: 61c14ceda840 ("x86/compressed/acpi: Move EFI config table lookup to = helper") Fixes: dee602dd5d14 ("x86/compressed/acpi: Move EFI vendor table lookup to = helper") Fixes: f9d230e893e8 ("x86/boot: Correct RSDP parsing with 32-bit EFI") Fixes: 81cc3df9a90e ("x86/sev: Check the VMPL level") Signed-off-by: Li Zetao Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers --- v1 -> v2: Remove unused variables "et" in efi_get_system_table(), "ret" in efi_get_conf_table(), "ret" in __efi_get_rsdp_addr() and "nr_tables" in efi_get_rsdp_addr() v2 -> v3: None v3 -> v4: Put this patch in front arch/x86/boot/compressed/acpi.c | 2 -- arch/x86/boot/compressed/efi.c | 2 -- arch/x86/boot/compressed/sev.c | 1 - 3 files changed, 5 deletions(-) diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acp= i.c index 9caf89063e77..21febd9f21ab 100644 --- a/arch/x86/boot/compressed/acpi.c +++ b/arch/x86/boot/compressed/acpi.c @@ -24,7 +24,6 @@ __efi_get_rsdp_addr(unsigned long cfg_tbl_pa, unsigned in= t cfg_tbl_len) { #ifdef CONFIG_EFI unsigned long rsdp_addr; - int ret; =20 /* * Search EFI system tables for RSDP. Preferred is ACPI_20_TABLE_GUID to @@ -52,7 +51,6 @@ static acpi_physical_address efi_get_rsdp_addr(void) unsigned long cfg_tbl_pa =3D 0; unsigned int cfg_tbl_len; unsigned long systab_pa; - unsigned int nr_tables; enum efi_type et; int ret; =20 diff --git a/arch/x86/boot/compressed/efi.c b/arch/x86/boot/compressed/efi.c index 6edd034b0b30..6ffd22710ed2 100644 --- a/arch/x86/boot/compressed/efi.c +++ b/arch/x86/boot/compressed/efi.c @@ -59,7 +59,6 @@ unsigned long efi_get_system_table(struct boot_params *bp) { unsigned long sys_tbl_pa; struct efi_info *ei; - enum efi_type et; =20 /* Get systab from boot params. */ ei =3D &bp->efi_info; @@ -131,7 +130,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; =20 if (!cfg_tbl_pa || !cfg_tbl_len) return -EINVAL; diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c index c93930d5ccbd..b9451761a69a 100644 --- a/arch/x86/boot/compressed/sev.c +++ b/arch/x86/boot/compressed/sev.c @@ -253,7 +253,6 @@ void do_boot_stage2_vc(struct pt_regs *regs, unsigned l= ong exit_code) static void enforce_vmpl0(void) { u64 attrs; - int err; =20 /* * RMPADJUST modifies RMP permissions of a lesser-privileged (numerically --=20 2.34.1