mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yu-Chun Lin <eleanor15x@gmail.com>
To: ardb@kernel.org
Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
	visitorckw@gmail.com, jserv@ccns.ncku.edu.tw,
	Yu-Chun Lin <eleanor15x@gmail.com>,
	kernel test robot <lkp@intel.com>
Subject: [PATCH] efi: sysfb_efi: guard EFI-specific code with CONFIG_EFI
Date: Wed, 15 Jan 2025 22:16:50 +0800	[thread overview]
Message-ID: <20250115141650.3658827-1-eleanor15x@gmail.com> (raw)

As reported by the kernel test robot, the following warnings occur:

>> drivers/firmware/efi/sysfb_efi.c:331:39: warning: 'efifb_fwnode_ops' defined but not used [-Wunused-const-variable=]
     331 | static const struct fwnode_operations efifb_fwnode_ops = {
         |                                       ^~~~~~~~~~~~~~~~
>> drivers/firmware/efi/sysfb_efi.c:240:35: warning: 'efifb_dmi_swap_width_height' defined but not used [-Wunused-const-variable=]
     240 | static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = {
         |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/firmware/efi/sysfb_efi.c:190:35: warning: 'efifb_dmi_system_table' defined but not used [-Wunused-const-variable=]
     190 | static const struct dmi_system_id efifb_dmi_system_table[] __initconst = {
         |                                   ^~~~~~~~~~~~~~~~~~~~~~

Unused variables, functions, and macro are conditionally compiled under
CONFIG_EFI. This includes 'efifb_fwnode_ops',
'efifb_dmi_swap_width_height[]', 'efifb_dmi_system_table[]',
'efifb_add_links', 'find_pci_overlap_node','efifb_set_system',
'efifb_overlaps_pci_range', and the 'EFIFB_DMI_SYSTEM_ID' macro.

Suppress unused symbol warnings and ensure inclusion only in relevant
configurations.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501051626.SMkizYIE-lkp@intel.com/
Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com>
---
 drivers/firmware/efi/sysfb_efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/sysfb_efi.c b/drivers/firmware/efi/sysfb_efi.c
index cc807ed35aed..4efe383cc470 100644
--- a/drivers/firmware/efi/sysfb_efi.c
+++ b/drivers/firmware/efi/sysfb_efi.c
@@ -174,6 +174,7 @@ static int __init efifb_set_system(const struct dmi_system_id *id)
 	return 1;
 }
 
+#ifdef CONFIG_EFI
 #define EFIFB_DMI_SYSTEM_ID(vendor, name, enumid)		\
 	{							\
 		efifb_set_system,				\
@@ -346,7 +347,6 @@ static const struct fwnode_operations efifb_fwnode_ops = {
 	.add_links = efifb_add_links,
 };
 
-#ifdef CONFIG_EFI
 static struct fwnode_handle efifb_fwnode;
 
 __init void sysfb_apply_efi_quirks(void)
-- 
2.43.0


             reply	other threads:[~2025-01-15 14:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15 14:16 Yu-Chun Lin [this message]
2025-01-15 14:46 ` Ard Biesheuvel
2025-01-15 15:21   ` Yu-Chun Lin
2025-01-15 15:24     ` Ard Biesheuvel

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=20250115141650.3658827-1-eleanor15x@gmail.com \
    --to=eleanor15x@gmail.com \
    --cc=ardb@kernel.org \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=visitorckw@gmail.com \
    /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®