* [PATCH 10/34] efi: sysfb: don't build when EFI is disabled
2024-04-03 8:06 [PATCH 00/34] address all -Wunused-const warnings Arnd Bergmann
@ 2024-04-03 8:06 ` Arnd Bergmann
2024-04-03 13:03 ` Ard Biesheuvel
2024-04-06 5:20 ` [PATCH 00/34] address all -Wunused-const warnings patchwork-bot+netdevbpf
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2024-04-03 8:06 UTC (permalink / raw)
To: linux-kernel, Ard Biesheuvel, Javier Martinez Canillas,
Randy Dunlap, Daniel Vetter
Cc: Arnd Bergmann, Ilias Apalodimas, Kirill A. Shutemov, Tom Lendacky,
Borislav Petkov (AMD), Masahisa Kojima, Rafael J. Wysocki,
Rob Herring, Saravana Kannan, Greg Kroah-Hartman, linux-efi
From: Arnd Bergmann <arnd@arndb.de>
With 'make W=1', there is a warning when EFI is turned off but sysfb_efi
still gets built:
drivers/firmware/efi/sysfb_efi.c:188:35: error: unused variable 'efifb_dmi_system_table' [-Werror,-Wunused-const-variable]
static const struct dmi_system_id efifb_dmi_system_table[] __initconst = {
^
drivers/firmware/efi/sysfb_efi.c:238:35: error: unused variable 'efifb_dmi_swap_width_height' [-Werror,-Wunused-const-variable]
static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = {
^
drivers/firmware/efi/sysfb_efi.c:297:28: error: unused function 'find_pci_overlap_node' [-Werror,-Wunused-function]
static struct device_node *find_pci_overlap_node(void)
There was an earlier patch to address the duplicate function definitions, but
that missed how we should not be building this file in the first place.
Fixes: 15d27b15de96 ("efi: sysfb_efi: fix build when EFI is not set")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/firmware/efi/Makefile | 3 ++-
drivers/firmware/efi/sysfb_efi.c | 2 --
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile
index a2d0009560d0..3baf80d8cf81 100644
--- a/drivers/firmware/efi/Makefile
+++ b/drivers/firmware/efi/Makefile
@@ -30,7 +30,8 @@ obj-$(CONFIG_EFI_RCI2_TABLE) += rci2-table.o
obj-$(CONFIG_EFI_EMBEDDED_FIRMWARE) += embedded-firmware.o
obj-$(CONFIG_LOAD_UEFI_KEYS) += mokvar-table.o
-obj-$(CONFIG_SYSFB) += sysfb_efi.o
+sysfb-$(CONFIG_SYSFB) += sysfb_efi.o
+obj-$(CONFIG_EFI) += $(sysfb-y)
arm-obj-$(CONFIG_EFI) := efi-init.o arm-runtime.o
obj-$(CONFIG_ARM) += $(arm-obj-y)
diff --git a/drivers/firmware/efi/sysfb_efi.c b/drivers/firmware/efi/sysfb_efi.c
index cc807ed35aed..a8c982475f6b 100644
--- a/drivers/firmware/efi/sysfb_efi.c
+++ b/drivers/firmware/efi/sysfb_efi.c
@@ -346,7 +346,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)
@@ -372,4 +371,3 @@ __init void sysfb_set_efifb_fwnode(struct platform_device *pd)
pd->dev.fwnode = &efifb_fwnode;
}
}
-#endif
--
2.39.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 10/34] efi: sysfb: don't build when EFI is disabled
2024-04-03 8:06 ` [PATCH 10/34] efi: sysfb: don't build when EFI is disabled Arnd Bergmann
@ 2024-04-03 13:03 ` Ard Biesheuvel
2024-04-03 13:15 ` Javier Martinez Canillas
0 siblings, 1 reply; 8+ messages in thread
From: Ard Biesheuvel @ 2024-04-03 13:03 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-kernel, Javier Martinez Canillas, Randy Dunlap,
Daniel Vetter, Arnd Bergmann, Ilias Apalodimas,
Kirill A. Shutemov, Tom Lendacky, Borislav Petkov (AMD),
Masahisa Kojima, Rafael J. Wysocki, Rob Herring, Saravana Kannan,
Greg Kroah-Hartman, linux-efi
On Wed, 3 Apr 2024 at 11:09, Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> With 'make W=1', there is a warning when EFI is turned off but sysfb_efi
> still gets built:
>
> drivers/firmware/efi/sysfb_efi.c:188:35: error: unused variable 'efifb_dmi_system_table' [-Werror,-Wunused-const-variable]
> static const struct dmi_system_id efifb_dmi_system_table[] __initconst = {
> ^
> drivers/firmware/efi/sysfb_efi.c:238:35: error: unused variable 'efifb_dmi_swap_width_height' [-Werror,-Wunused-const-variable]
> static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = {
> ^
> drivers/firmware/efi/sysfb_efi.c:297:28: error: unused function 'find_pci_overlap_node' [-Werror,-Wunused-function]
> static struct device_node *find_pci_overlap_node(void)
>
> There was an earlier patch to address the duplicate function definitions, but
> that missed how we should not be building this file in the first place.
>
> Fixes: 15d27b15de96 ("efi: sysfb_efi: fix build when EFI is not set")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
or I can take it via the EFI tree if you prefer.
> ---
> drivers/firmware/efi/Makefile | 3 ++-
> drivers/firmware/efi/sysfb_efi.c | 2 --
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile
> index a2d0009560d0..3baf80d8cf81 100644
> --- a/drivers/firmware/efi/Makefile
> +++ b/drivers/firmware/efi/Makefile
> @@ -30,7 +30,8 @@ obj-$(CONFIG_EFI_RCI2_TABLE) += rci2-table.o
> obj-$(CONFIG_EFI_EMBEDDED_FIRMWARE) += embedded-firmware.o
> obj-$(CONFIG_LOAD_UEFI_KEYS) += mokvar-table.o
>
> -obj-$(CONFIG_SYSFB) += sysfb_efi.o
> +sysfb-$(CONFIG_SYSFB) += sysfb_efi.o
> +obj-$(CONFIG_EFI) += $(sysfb-y)
>
> arm-obj-$(CONFIG_EFI) := efi-init.o arm-runtime.o
> obj-$(CONFIG_ARM) += $(arm-obj-y)
> diff --git a/drivers/firmware/efi/sysfb_efi.c b/drivers/firmware/efi/sysfb_efi.c
> index cc807ed35aed..a8c982475f6b 100644
> --- a/drivers/firmware/efi/sysfb_efi.c
> +++ b/drivers/firmware/efi/sysfb_efi.c
> @@ -346,7 +346,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)
> @@ -372,4 +371,3 @@ __init void sysfb_set_efifb_fwnode(struct platform_device *pd)
> pd->dev.fwnode = &efifb_fwnode;
> }
> }
> -#endif
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 10/34] efi: sysfb: don't build when EFI is disabled
2024-04-03 13:03 ` Ard Biesheuvel
@ 2024-04-03 13:15 ` Javier Martinez Canillas
0 siblings, 0 replies; 8+ messages in thread
From: Javier Martinez Canillas @ 2024-04-03 13:15 UTC (permalink / raw)
To: Ard Biesheuvel, Arnd Bergmann
Cc: linux-kernel, Randy Dunlap, Daniel Vetter, Arnd Bergmann,
Ilias Apalodimas, Kirill A. Shutemov, Tom Lendacky,
Borislav Petkov (AMD), Masahisa Kojima, Rafael J. Wysocki,
Rob Herring, Saravana Kannan, Greg Kroah-Hartman, linux-efi
Ard Biesheuvel <ardb@kernel.org> writes:
> On Wed, 3 Apr 2024 at 11:09, Arnd Bergmann <arnd@kernel.org> wrote:
>>
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> With 'make W=1', there is a warning when EFI is turned off but sysfb_efi
>> still gets built:
>>
>> drivers/firmware/efi/sysfb_efi.c:188:35: error: unused variable 'efifb_dmi_system_table' [-Werror,-Wunused-const-variable]
>> static const struct dmi_system_id efifb_dmi_system_table[] __initconst = {
>> ^
>> drivers/firmware/efi/sysfb_efi.c:238:35: error: unused variable 'efifb_dmi_swap_width_height' [-Werror,-Wunused-const-variable]
>> static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = {
>> ^
>> drivers/firmware/efi/sysfb_efi.c:297:28: error: unused function 'find_pci_overlap_node' [-Werror,-Wunused-function]
>> static struct device_node *find_pci_overlap_node(void)
>>
>> There was an earlier patch to address the duplicate function definitions, but
>> that missed how we should not be building this file in the first place.
>>
>> Fixes: 15d27b15de96 ("efi: sysfb_efi: fix build when EFI is not set")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Acked-by: Ard Biesheuvel <ardb@kernel.org>
>
Looks good to me too.
Acked-by: Javier Martinez Canillas <javierm@redhat.com>
> or I can take it via the EFI tree if you prefer.
>
I think that could be merged through your EFI tree. Thanks!
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 00/34] address all -Wunused-const warnings
2024-04-03 8:06 [PATCH 00/34] address all -Wunused-const warnings Arnd Bergmann
2024-04-03 8:06 ` [PATCH 10/34] efi: sysfb: don't build when EFI is disabled Arnd Bergmann
@ 2024-04-06 5:20 ` patchwork-bot+netdevbpf
2024-04-10 8:02 ` (subset) " Sebastian Reichel
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-06 5:20 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-kernel, arnd, mpe, christophe.leroy, dlemoal, jikos, gregkh,
minyard, peterhuewe, jarkko, kristo, sboyd, abbotti, hsweeten,
srinivas.pandruvada, lenb, rafael, john.allen, herbert, vkoul,
ardb, andersson, mdf, liviu.dudau, benjamin.tissoires, andi.shyti,
michael.hennerich, peda, lars, jic23, dmitry.torokhov,
markuss.broks, alexandre.torgue, lee, kuba, Shyam-sundar.S-k,
iyappan, yisen.zhuang, stf_xl, kvalo, sre, tony, broonie,
alexandre.belloni, chenxiang66, martin.petersen, neil.armstrong,
heiko, krzysztof.kozlowski, hvaibhav.linux, elder, jirislaby,
ychuang3, deller, hch, robin.murphy, rostedt, mhiramat, akpm,
keescook, trond.myklebust, anna, masahiroy, nathan, tiwai,
linuxppc-dev, linux-ide, openipmi-developer, linux-integrity,
linux-omap, linux-clk, linux-pm, linux-crypto, dmaengine,
linux-efi, linux-arm-msm, linux-fpga, dri-devel, linux-input,
linux-i2c, linux-iio, linux-stm32, linux-arm-kernel, netdev,
linux-leds, linux-wireless, linux-rtc, linux-scsi, linux-spi,
linux-amlogic, linux-rockchip, linux-samsung-soc, greybus-dev,
linux-staging, linux-serial, linux-usb, linux-fbdev, iommu,
linux-trace-kernel, kasan-dev, linux-hardening, linux-nfs,
linux-kbuild, alsa-devel, linux-sound
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 3 Apr 2024 10:06:18 +0200 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Compilers traditionally warn for unused 'static' variables, but not
> if they are constant. The reason here is a custom for C++ programmers
> to define named constants as 'static const' variables in header files
> instead of using macros or enums.
>
> [...]
Here is the summary with links:
- [05/34] 3c515: remove unused 'mtu' variable
https://git.kernel.org/netdev/net-next/c/17b35355c2c6
- [19/34] sunrpc: suppress warnings for unused procfs functions
(no matching commit)
- [26/34] isdn: kcapi: don't build unused procfs code
https://git.kernel.org/netdev/net-next/c/91188544af06
- [28/34] net: xgbe: remove extraneous #ifdef checks
https://git.kernel.org/netdev/net-next/c/0ef416e045ad
- [33/34] drivers: remove incorrect of_match_ptr/ACPI_PTR annotations
(no matching commit)
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: (subset) [PATCH 00/34] address all -Wunused-const warnings
2024-04-03 8:06 [PATCH 00/34] address all -Wunused-const warnings Arnd Bergmann
2024-04-03 8:06 ` [PATCH 10/34] efi: sysfb: don't build when EFI is disabled Arnd Bergmann
2024-04-06 5:20 ` [PATCH 00/34] address all -Wunused-const warnings patchwork-bot+netdevbpf
@ 2024-04-10 8:02 ` Sebastian Reichel
2024-04-22 8:16 ` Michael Ellerman
2025-01-27 13:24 ` Andy Shevchenko
4 siblings, 0 replies; 8+ messages in thread
From: Sebastian Reichel @ 2024-04-10 8:02 UTC (permalink / raw)
To: linux-kernel, Arnd Bergmann
Cc: Arnd Bergmann, Michael Ellerman, Christophe Leroy, Damien Le Moal,
Jiri Kosina, Greg Kroah-Hartman, Corey Minyard, Peter Huewe,
Jarkko Sakkinen, Tero Kristo, Stephen Boyd, Ian Abbott,
H Hartley Sweeten, Srinivas Pandruvada, Len Brown,
Rafael J. Wysocki, John Allen, Herbert Xu, Vinod Koul,
Ard Biesheuvel, Bjorn Andersson, Moritz Fischer, Liviu Dudau,
Benjamin Tissoires, Andi Shyti, Michael Hennerich, Peter Rosin,
Lars-Peter Clausen, Jonathan Cameron, Dmitry Torokhov,
Markuss Broks, Alexandre Torgue, Lee Jones, Jakub Kicinski,
Shyam Sundar S K, Iyappan Subramanian, Yisen Zhuang,
Stanislaw Gruszka, Kalle Valo, Sebastian Reichel, Tony Lindgren,
Mark Brown, Alexandre Belloni, Xiang Chen, Martin K. Petersen,
Neil Armstrong, Heiko Stuebner, Krzysztof Kozlowski,
Vaibhav Hiremath, Alex Elder, Jiri Slaby, Jacky Huang,
Helge Deller, Christoph Hellwig, Robin Murphy, Steven Rostedt,
Masami Hiramatsu, Andrew Morton, Kees Cook, Trond Myklebust,
Anna Schumaker, Masahiro Yamada, Nathan Chancellor, Takashi Iwai,
linuxppc-dev, linux-ide, openipmi-developer, linux-integrity,
linux-omap, linux-clk, linux-pm, linux-crypto, dmaengine,
linux-efi, linux-arm-msm, linux-fpga, dri-devel, linux-input,
linux-i2c, linux-iio, linux-stm32, linux-arm-kernel, netdev,
linux-leds, linux-wireless, linux-rtc, linux-scsi, linux-spi,
linux-amlogic, linux-rockchip, linux-samsung-soc, greybus-dev,
linux-staging, linux-serial, linux-usb, linux-fbdev, iommu,
linux-trace-kernel, kasan-dev, linux-hardening, linux-nfs,
linux-kbuild, alsa-devel, linux-sound
On Wed, 03 Apr 2024 10:06:18 +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Compilers traditionally warn for unused 'static' variables, but not
> if they are constant. The reason here is a custom for C++ programmers
> to define named constants as 'static const' variables in header files
> instead of using macros or enums.
>
> [...]
Applied, thanks!
[09/34] power: rt9455: hide unused rt9455_boost_voltage_values
commit: 452d8950db3e839aba1bb13bc5378f4bac11fa04
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: (subset) [PATCH 00/34] address all -Wunused-const warnings
2024-04-03 8:06 [PATCH 00/34] address all -Wunused-const warnings Arnd Bergmann
` (2 preceding siblings ...)
2024-04-10 8:02 ` (subset) " Sebastian Reichel
@ 2024-04-22 8:16 ` Michael Ellerman
2025-01-27 13:24 ` Andy Shevchenko
4 siblings, 0 replies; 8+ messages in thread
From: Michael Ellerman @ 2024-04-22 8:16 UTC (permalink / raw)
To: linux-kernel, Arnd Bergmann
Cc: Arnd Bergmann, Michael Ellerman, Christophe Leroy, Damien Le Moal,
Jiri Kosina, Greg Kroah-Hartman, Corey Minyard, Peter Huewe,
Jarkko Sakkinen, Tero Kristo, Stephen Boyd, Ian Abbott,
H Hartley Sweeten, Srinivas Pandruvada, Len Brown,
Rafael J. Wysocki, John Allen, Herbert Xu, Vinod Koul,
Ard Biesheuvel, Bjorn Andersson, Moritz Fischer, Liviu Dudau,
Benjamin Tissoires, Andi Shyti, Michael Hennerich
On Wed, 03 Apr 2024 10:06:18 +0200, Arnd Bergmann wrote:
> Compilers traditionally warn for unused 'static' variables, but not
> if they are constant. The reason here is a custom for C++ programmers
> to define named constants as 'static const' variables in header files
> instead of using macros or enums.
>
> In W=1 builds, we get warnings only static const variables in C
> files, but not in headers, which is a good compromise, but this still
> produces warning output in at least 30 files. These warnings are
> almost all harmless, but also trivial to fix, and there is no
> good reason to warn only about the non-const variables being unused.
>
> [...]
Applied to powerpc/next.
[01/34] powerpc/fsl-soc: hide unused const variable
https://git.kernel.org/powerpc/c/01acaf3aa75e1641442cc23d8fe0a7bb4226efb1
cheers
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 00/34] address all -Wunused-const warnings
2024-04-03 8:06 [PATCH 00/34] address all -Wunused-const warnings Arnd Bergmann
` (3 preceding siblings ...)
2024-04-22 8:16 ` Michael Ellerman
@ 2025-01-27 13:24 ` Andy Shevchenko
4 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2025-01-27 13:24 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-kernel, Arnd Bergmann, Michael Ellerman, Christophe Leroy,
Damien Le Moal, Jiri Kosina, Greg Kroah-Hartman, Corey Minyard,
Peter Huewe, Jarkko Sakkinen, Tero Kristo, Stephen Boyd,
Ian Abbott, H Hartley Sweeten, Srinivas Pandruvada, Len Brown,
Rafael J. Wysocki, John Allen, Herbert Xu, Vinod Koul,
Ard Biesheuvel, Bjorn Andersson, Moritz Fischer, Liviu Dudau,
Benjamin Tissoires, Andi Shyti, Michael Hennerich, Peter Rosin,
Lars-Peter Clausen, Jonathan Cameron, Dmitry Torokhov,
Markuss Broks, Alexandre Torgue, Lee Jones, Jakub Kicinski,
Shyam Sundar S K, Iyappan Subramanian, Yisen Zhuang,
Stanislaw Gruszka, Kalle Valo, Sebastian Reichel, Tony Lindgren,
Mark Brown, Alexandre Belloni, Xiang Chen, Martin K. Petersen,
Neil Armstrong, Heiko Stuebner, Krzysztof Kozlowski,
Vaibhav Hiremath, Alex Elder, Jiri Slaby, Jacky Huang,
Helge Deller, Christoph Hellwig, Robin Murphy, Steven Rostedt,
Masami Hiramatsu, Andrew Morton, Kees Cook, Trond Myklebust,
Anna Schumaker, Masahiro Yamada, Nathan Chancellor, Takashi Iwai,
linuxppc-dev, linux-ide, openipmi-developer, linux-integrity,
linux-omap, linux-clk, linux-pm, linux-crypto, dmaengine,
linux-efi, linux-arm-msm, linux-fpga, dri-devel, linux-input,
linux-i2c, linux-iio, linux-stm32, linux-arm-kernel, netdev,
linux-leds, linux-wireless, linux-rtc, linux-scsi, linux-spi,
linux-amlogic, linux-rockchip, linux-samsung-soc, greybus-dev,
linux-staging, linux-serial, linux-usb, linux-fbdev, iommu,
linux-trace-kernel, kasan-dev, linux-hardening, linux-nfs,
linux-kbuild, alsa-devel, linux-sound
On Wed, Apr 03, 2024 at 10:06:18AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Compilers traditionally warn for unused 'static' variables, but not
> if they are constant. The reason here is a custom for C++ programmers
> to define named constants as 'static const' variables in header files
> instead of using macros or enums.
>
> In W=1 builds, we get warnings only static const variables in C
> files, but not in headers, which is a good compromise, but this still
> produces warning output in at least 30 files. These warnings are
> almost all harmless, but also trivial to fix, and there is no
> good reason to warn only about the non-const variables being unused.
>
> I've gone through all the files that I found using randconfig and
> allmodconfig builds and created patches to avoid these warnings,
> with the goal of retaining a clean build once the option is enabled
> by default.
>
> Unfortunately, there is one fairly large patch ("drivers: remove
> incorrect of_match_ptr/ACPI_PTR annotations") that touches
> 34 individual drivers that all need the same one-line change.
> If necessary, I can split it up by driver or by subsystem,
> but at least for reviewing I would keep it as one piece for
> the moment.
>
> Please merge the individual patches through subsystem trees.
> I expect that some of these will have to go through multiple
> revisions before they are picked up, so anything that gets
> applied early saves me from resending.
Arnd, can you refresh this one? It seems some misses still...
I have got 3+ 0-day reports against one of the mux drivers.
https://lore.kernel.org/all/?q=adg792a.c
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 8+ messages in thread