* [PATCH v2] efi: sysfb_efi: Fix unused const variable 'efifb_fwnode_ops'
@ 2024-10-26 7:02 Zeng Heng
2024-11-15 9:34 ` Ard Biesheuvel
0 siblings, 1 reply; 2+ messages in thread
From: Zeng Heng @ 2024-10-26 7:02 UTC (permalink / raw)
To: tzimmermann, javierm, andriy.shevchenko, ardb, bp, simona.vetter
Cc: bobo.shaobowang, linux-kernel, linux-efi
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 = {
In addition to the above warning messages, a series of unused warnings
because of cascading dependencies were found. The variables and functions
related to warnings are only used after CONFIG_EFI enabled. Therefore,
these warnings are addressed and fixed in this commit.
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 | 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..0cfc11ecc98b 100644
--- a/drivers/firmware/efi/sysfb_efi.c
+++ b/drivers/firmware/efi/sysfb_efi.c
@@ -82,6 +82,7 @@ void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
}
}
+#ifdef CONFIG_EFI
#define choose_value(dmivalue, fwvalue, field, flags) ({ \
typeof(fwvalue) _ret_ = fwvalue; \
if ((flags) & (field)) \
@@ -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.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] efi: sysfb_efi: Fix unused const variable 'efifb_fwnode_ops'
2024-10-26 7:02 [PATCH v2] efi: sysfb_efi: Fix unused const variable 'efifb_fwnode_ops' Zeng Heng
@ 2024-11-15 9:34 ` Ard Biesheuvel
0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2024-11-15 9:34 UTC (permalink / raw)
To: Zeng Heng
Cc: tzimmermann, javierm, andriy.shevchenko, bp, simona.vetter,
bobo.shaobowang, linux-kernel, linux-efi
On Sat, 26 Oct 2024 at 08:48, Zeng Heng <zengheng4@huawei.com> wrote:
>
> 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 = {
>
> In addition to the above warning messages, a series of unused warnings
> because of cascading dependencies were found. The variables and functions
> related to warnings are only used after CONFIG_EFI enabled. Therefore,
> these warnings are addressed and fixed in this commit.
>
> 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 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Is there any reason to build this file in the first place if
CONFIG_EFI is disabled? Should we fix this in the Makefile instead?
> diff --git a/drivers/firmware/efi/sysfb_efi.c b/drivers/firmware/efi/sysfb_efi.c
> index cc807ed35aed..0cfc11ecc98b 100644
> --- a/drivers/firmware/efi/sysfb_efi.c
> +++ b/drivers/firmware/efi/sysfb_efi.c
> @@ -82,6 +82,7 @@ void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
> }
> }
>
> +#ifdef CONFIG_EFI
> #define choose_value(dmivalue, fwvalue, field, flags) ({ \
> typeof(fwvalue) _ret_ = fwvalue; \
> if ((flags) & (field)) \
> @@ -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.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-15 9:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-26 7:02 [PATCH v2] efi: sysfb_efi: Fix unused const variable 'efifb_fwnode_ops' Zeng Heng
2024-11-15 9:34 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox