mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zeng Heng <zengheng4@huawei.com>
To: <bp@suse.de>, <javierm@redhat.com>, <ardb@kernel.org>,
	<tzimmermann@suse.de>, <simona.vetter@ffwll.ch>
Cc: <linux-kernel@vger.kernel.org>, <bobo.shaobowang@huawei.com>,
	<linux-efi@vger.kernel.org>
Subject: [PATCH] drivers/firmware: Fix unused const variable 'efifb_fwnode_ops'
Date: Thu, 24 Oct 2024 16:44:35 +0800	[thread overview]
Message-ID: <20241024084435.165333-1-zengheng4@huawei.com> (raw)

Fix the following compilation warning:

drivers/firmware/efi/sysfb_efi.c:345:39: warning:
‘efifb_fwnode_ops’ defined but not used [-Wunused-const-variable=]
  345 | static const struct fwnode_operations efifb_fwnode_ops = {

drivers/firmware/efi/sysfb_efi.c:238:35: warning:
‘efifb_dmi_swap_width_height’ defined but not used
[-Wunused-const-variable=]
  238 | static const struct dmi_system_id
	efifb_dmi_swap_width_height[] __initconst = {

drivers/firmware/efi/sysfb_efi.c:188:35: warning:
‘efifb_dmi_system_table’ defined but not used
[-Wunused-const-variable=]
  188 | static const struct dmi_system_id
	efifb_dmi_system_table[] __initconst = {

Only define the const variables when the CONFIG_EFI is enabled.

Fixes: 8633ef82f101 ("drivers/firmware: consolidate EFI framebuffer setup for all arches")
Signed-off-by: Zeng Heng <zengheng4@huawei.com>
---
 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_system_id *id)
 		&efifb_dmi_list[enumid]				\
 	}
 
+#ifdef CONFIG_EFI
 static const struct dmi_system_id efifb_dmi_system_table[] __initconst = {
 	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 = {
 	},
 	{},
 };
+#endif
 
 static bool efifb_overlaps_pci_range(const struct of_pci_range *range)
 {
@@ -342,10 +344,6 @@ static int efifb_add_links(struct fwnode_handle *fwnode)
 	return 0;
 }
 
-static const struct fwnode_operations efifb_fwnode_ops = {
-	.add_links = efifb_add_links,
-};
-
 #ifdef CONFIG_EFI
 static struct fwnode_handle efifb_fwnode;
 
@@ -365,6 +363,10 @@ __init void sysfb_apply_efi_quirks(void)
 	}
 }
 
+static const struct fwnode_operations efifb_fwnode_ops = {
+	.add_links = efifb_add_links,
+};
+
 __init void sysfb_set_efifb_fwnode(struct platform_device *pd)
 {
 	if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI && IS_ENABLED(CONFIG_PCI)) {
-- 
2.25.1


             reply	other threads:[~2024-10-24  8:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24  8:44 Zeng Heng [this message]
2024-10-25  5:03 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241024084435.165333-1-zengheng4@huawei.com \
    --to=zengheng4@huawei.com \
    --cc=ardb@kernel.org \
    --cc=bobo.shaobowang@huawei.com \
    --cc=bp@suse.de \
    --cc=javierm@redhat.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=simona.vetter@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®