From nobody Mon Nov 25 21:21:17 2024 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (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 DEF526F305; Thu, 24 Oct 2024 08:30:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729758662; cv=none; b=kUXkgE6DISU5Tqu3dydJV7+6e+kTfe+kLb1muosJ0ItEOPKnez8lLsrzADx6KbeO3Sf9Wh83Bjg2//hrPJrX17O+vGp/xpYjvFwmQ8j0k6A614zQSjVxM6SfDeojioKpDE6Vb5eejoxGtEqzfQXMNBgGmdQNTBsHuEqNGoRb/2g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729758662; c=relaxed/simple; bh=mnuase4KjjRfWvoiy0xsaSM8UmdLqsG14Aah3SnoHwY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=EeyZKHdb8DMDQAOyhPcIcRh9QM4OacALPgoiVlWdTyIn+xr3ZCFbuXWUVgC3U0/4cpvxMeBt69591OF9b39VUpy503nQE6d3a80vlHWjMpCcNJDa9q4KnWOsK87xF4onfL8CJnoBoKptokKiUZJjOJduxsOW+qq9VJB/cGROW9Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4XYzdc5Y02z1ynPv; Thu, 24 Oct 2024 16:31:00 +0800 (CST) Received: from kwepemf100008.china.huawei.com (unknown [7.202.181.222]) by mail.maildlp.com (Postfix) with ESMTPS id 4CFCD1400CB; Thu, 24 Oct 2024 16:30:53 +0800 (CST) Received: from huawei.com (10.175.103.91) by kwepemf100008.china.huawei.com (7.202.181.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 24 Oct 2024 16:30:52 +0800 From: Zeng Heng To: , , , , CC: , , Subject: [PATCH] drivers/firmware: Fix unused const variable 'efifb_fwnode_ops' Date: Thu, 24 Oct 2024 16:44:35 +0800 Message-ID: <20241024084435.165333-1-zengheng4@huawei.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemf100008.china.huawei.com (7.202.181.222) Fix the following compilation warning: drivers/firmware/efi/sysfb_efi.c:345:39: warning: =E2=80=98efifb_fwnode_ops=E2=80=99 defined but not used [-Wunused-const-var= iable=3D] 345 | static const struct fwnode_operations efifb_fwnode_ops =3D { drivers/firmware/efi/sysfb_efi.c:238:35: warning: =E2=80=98efifb_dmi_swap_width_height=E2=80=99 defined but not used [-Wunused-const-variable=3D] 238 | static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst =3D { drivers/firmware/efi/sysfb_efi.c:188:35: warning: =E2=80=98efifb_dmi_system_table=E2=80=99 defined but not used [-Wunused-const-variable=3D] 188 | static const struct dmi_system_id efifb_dmi_system_table[] __initconst =3D { Only define the const variables when the CONFIG_EFI is enabled. Fixes: 8633ef82f101 ("drivers/firmware: consolidate EFI framebuffer setup f= or all arches") Signed-off-by: Zeng Heng --- drivers/firmware/efi/sysfb_efi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/efi/sysfb_efi.c b/drivers/firmware/efi/sysfb_= efi.c index cc807ed35aed..f75bfe9b197c 100644 --- a/drivers/firmware/efi/sysfb_efi.c +++ b/drivers/firmware/efi/sysfb_efi.c @@ -185,6 +185,7 @@ static int __init efifb_set_system(const struct dmi_sys= tem_id *id) &efifb_dmi_list[enumid] \ } =20 +#ifdef CONFIG_EFI static const struct dmi_system_id efifb_dmi_system_table[] __initconst =3D= { EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "iMac4,1", M_I17), /* At least one of these two will be right; maybe both? */ @@ -282,6 +283,7 @@ static const struct dmi_system_id efifb_dmi_swap_width_= height[] __initconst =3D { }, {}, }; +#endif =20 static bool efifb_overlaps_pci_range(const struct of_pci_range *range) { @@ -342,10 +344,6 @@ static int efifb_add_links(struct fwnode_handle *fwnod= e) return 0; } =20 -static const struct fwnode_operations efifb_fwnode_ops =3D { - .add_links =3D efifb_add_links, -}; - #ifdef CONFIG_EFI static struct fwnode_handle efifb_fwnode; =20 @@ -365,6 +363,10 @@ __init void sysfb_apply_efi_quirks(void) } } =20 +static const struct fwnode_operations efifb_fwnode_ops =3D { + .add_links =3D efifb_add_links, +}; + __init void sysfb_set_efifb_fwnode(struct platform_device *pd) { if (screen_info.orig_video_isVGA =3D=3D VIDEO_TYPE_EFI && IS_ENABLED(CONF= IG_PCI)) { --=20 2.25.1