lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMj1kXETHkWvHEs9TuRxB61KvFr11SrLnQGuQTiVtupeAvFCMA@mail.gmail.com>
Date: Fri, 15 Nov 2024 10:34:23 +0100
From: Ard Biesheuvel <ardb@...nel.org>
To: Zeng Heng <zengheng4@...wei.com>
Cc: tzimmermann@...e.de, javierm@...hat.com, andriy.shevchenko@...el.com, 
	bp@...e.de, simona.vetter@...ll.ch, bobo.shaobowang@...wei.com, 
	linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org
Subject: Re: [PATCH v2] efi: sysfb_efi: Fix unused const variable 'efifb_fwnode_ops'

On Sat, 26 Oct 2024 at 08:48, Zeng Heng <zengheng4@...wei.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@...wei.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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ