Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH] efi: sysfb_efi: fix W=1 warnings when EFI is not set
@ 2025-01-07 23:53 Randy Dunlap
  2025-01-08  8:08 ` Thomas Zimmermann
  2025-01-08  8:22 ` Javier Martinez Canillas
  0 siblings, 2 replies; 4+ messages in thread
From: Randy Dunlap @ 2025-01-07 23:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, kernel test robot, David Rheinsberg, Hans de Goede,
	Javier Martinez Canillas, Peter Jones, Simona Vetter, linux-fbdev,
	Ard Biesheuvel, linux-efi

A build with W=1 fails because there are code and data that are not
needed or used when CONFIG_EFI is not set. Move the "#ifdef CONFIG_EFI"
block to earlier in the source file so that the unused code/data are
not built.

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 = {
      |                                   ^~~~~~~~~~~~~~~~~~~~~~

Fixes: 15d27b15de96 ("efi: sysfb_efi: fix build when EFI is not set")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501071933.20nlmJJt-lkp@intel.com/
Cc: David Rheinsberg <david@readahead.eu>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Peter Jones <pjones@redhat.com>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: linux-fbdev@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-efi@vger.kernel.org
---
 drivers/firmware/efi/sysfb_efi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20250106.orig/drivers/firmware/efi/sysfb_efi.c
+++ linux-next-20250106/drivers/firmware/efi/sysfb_efi.c
@@ -91,6 +91,7 @@ void efifb_setup_from_dmi(struct screen_
 		_ret_;						\
 	})
 
+#ifdef CONFIG_EFI
 static int __init efifb_set_system(const struct dmi_system_id *id)
 {
 	struct efifb_dmi_info *info = id->driver_data;
@@ -346,7 +347,6 @@ static const struct fwnode_operations ef
 	.add_links = efifb_add_links,
 };
 
-#ifdef CONFIG_EFI
 static struct fwnode_handle efifb_fwnode;
 
 __init void sysfb_apply_efi_quirks(void)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] efi: sysfb_efi: fix W=1 warnings when EFI is not set
  2025-01-07 23:53 [PATCH] efi: sysfb_efi: fix W=1 warnings when EFI is not set Randy Dunlap
@ 2025-01-08  8:08 ` Thomas Zimmermann
  2025-01-08  8:22 ` Javier Martinez Canillas
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2025-01-08  8:08 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: kernel test robot, David Rheinsberg, Hans de Goede,
	Javier Martinez Canillas, Peter Jones, Simona Vetter, linux-fbdev,
	Ard Biesheuvel, linux-efi




Am 08.01.25 um 00:53 schrieb Randy Dunlap:
> A build with W=1 fails because there are code and data that are not
> needed or used when CONFIG_EFI is not set. Move the "#ifdef CONFIG_EFI"
> block to earlier in the source file so that the unused code/data are
> not built.
>
> 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 = {
>        |                                   ^~~~~~~~~~~~~~~~~~~~~~
>
> Fixes: 15d27b15de96 ("efi: sysfb_efi: fix build when EFI is not set")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202501071933.20nlmJJt-lkp@intel.com/
> Cc: David Rheinsberg <david@readahead.eu>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Javier Martinez Canillas <javierm@redhat.com>
> Cc: Peter Jones <pjones@redhat.com>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: linux-fbdev@vger.kernel.org
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: linux-efi@vger.kernel.org

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/firmware/efi/sysfb_efi.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-next-20250106.orig/drivers/firmware/efi/sysfb_efi.c
> +++ linux-next-20250106/drivers/firmware/efi/sysfb_efi.c
> @@ -91,6 +91,7 @@ void efifb_setup_from_dmi(struct screen_
>   		_ret_;						\
>   	})
>   
> +#ifdef CONFIG_EFI
>   static int __init efifb_set_system(const struct dmi_system_id *id)
>   {
>   	struct efifb_dmi_info *info = id->driver_data;
> @@ -346,7 +347,6 @@ static const struct fwnode_operations ef
>   	.add_links = efifb_add_links,
>   };
>   
> -#ifdef CONFIG_EFI
>   static struct fwnode_handle efifb_fwnode;
>   
>   __init void sysfb_apply_efi_quirks(void)
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] efi: sysfb_efi: fix W=1 warnings when EFI is not set
  2025-01-07 23:53 [PATCH] efi: sysfb_efi: fix W=1 warnings when EFI is not set Randy Dunlap
  2025-01-08  8:08 ` Thomas Zimmermann
@ 2025-01-08  8:22 ` Javier Martinez Canillas
  2025-01-08 16:38   ` Ard Biesheuvel
  1 sibling, 1 reply; 4+ messages in thread
From: Javier Martinez Canillas @ 2025-01-08  8:22 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Randy Dunlap, kernel test robot, David Rheinsberg, Hans de Goede,
	Peter Jones, Simona Vetter, linux-fbdev, Ard Biesheuvel,
	linux-efi

Randy Dunlap <rdunlap@infradead.org> writes:

Hello Randy,

> A build with W=1 fails because there are code and data that are not
> needed or used when CONFIG_EFI is not set. Move the "#ifdef CONFIG_EFI"
> block to earlier in the source file so that the unused code/data are
> not built.
>
> 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 = {
>       |                                   ^~~~~~~~~~~~~~~~~~~~~~
>
> Fixes: 15d27b15de96 ("efi: sysfb_efi: fix build when EFI is not set")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202501071933.20nlmJJt-lkp@intel.com/
> Cc: David Rheinsberg <david@readahead.eu>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Javier Martinez Canillas <javierm@redhat.com>
> Cc: Peter Jones <pjones@redhat.com>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: linux-fbdev@vger.kernel.org
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: linux-efi@vger.kernel.org
> ---
>  drivers/firmware/efi/sysfb_efi.c |    2 +-

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] efi: sysfb_efi: fix W=1 warnings when EFI is not set
  2025-01-08  8:22 ` Javier Martinez Canillas
@ 2025-01-08 16:38   ` Ard Biesheuvel
  0 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2025-01-08 16:38 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: Randy Dunlap, linux-kernel, kernel test robot, David Rheinsberg,
	Hans de Goede, Peter Jones, Simona Vetter, linux-fbdev, linux-efi

On Wed, 8 Jan 2025 at 09:22, Javier Martinez Canillas
<javierm@redhat.com> wrote:
>
> Randy Dunlap <rdunlap@infradead.org> writes:
>
> Hello Randy,
>
> > A build with W=1 fails because there are code and data that are not
> > needed or used when CONFIG_EFI is not set. Move the "#ifdef CONFIG_EFI"
> > block to earlier in the source file so that the unused code/data are
> > not built.
> >
> > 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 = {
> >       |                                   ^~~~~~~~~~~~~~~~~~~~~~
> >
> > Fixes: 15d27b15de96 ("efi: sysfb_efi: fix build when EFI is not set")
> > Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202501071933.20nlmJJt-lkp@intel.com/
> > Cc: David Rheinsberg <david@readahead.eu>
> > Cc: Hans de Goede <hdegoede@redhat.com>
> > Cc: Javier Martinez Canillas <javierm@redhat.com>
> > Cc: Peter Jones <pjones@redhat.com>
> > Cc: Simona Vetter <simona@ffwll.ch>
> > Cc: linux-fbdev@vger.kernel.org
> > Cc: Ard Biesheuvel <ardb@kernel.org>
> > Cc: linux-efi@vger.kernel.org
> > ---
> >  drivers/firmware/efi/sysfb_efi.c |    2 +-
>
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
>

Thanks all. I'll queue this up.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-08 16:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-07 23:53 [PATCH] efi: sysfb_efi: fix W=1 warnings when EFI is not set Randy Dunlap
2025-01-08  8:08 ` Thomas Zimmermann
2025-01-08  8:22 ` Javier Martinez Canillas
2025-01-08 16:38   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox