* [PATCH 01/34] powerpc/fsl-soc: hide unused const variable
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 8:19 ` Christophe Leroy
2024-04-06 5:20 ` [PATCH 00/34] address all -Wunused-const warnings patchwork-bot+netdevbpf
` (3 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2024-04-03 8:06 UTC (permalink / raw)
To: linux-kernel, Michael Ellerman, Alexander Graf, Stuart Yoder,
Scott Wood
Cc: Rob Herring, Arnd Bergmann, Aneesh Kumar K.V, Nicholas Piggin,
Uwe Kleine-König, Naveen N. Rao, linuxppc-dev
From: Arnd Bergmann <arnd@arndb.de>
vmpic_msi_feature is only used conditionally, which triggers a rare
-Werror=unused-const-variable= warning with gcc:
arch/powerpc/sysdev/fsl_msi.c:567:37: error: 'vmpic_msi_feature' defined but not used [-Werror=unused-const-variable=]
567 | static const struct fsl_msi_feature vmpic_msi_feature =
Hide this one in the same #ifdef as the reference so we can turn on
the warning by default.
Fixes: 305bcf26128e ("powerpc/fsl-soc: use CONFIG_EPAPR_PARAVIRT for hcalls")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/powerpc/sysdev/fsl_msi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 8e6c84df4ca1..e205135ae1fe 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -564,10 +564,12 @@ static const struct fsl_msi_feature ipic_msi_feature = {
.msiir_offset = 0x38,
};
+#ifdef CONFIG_EPAPR_PARAVIRT
static const struct fsl_msi_feature vmpic_msi_feature = {
.fsl_pic_ip = FSL_PIC_IP_VMPIC,
.msiir_offset = 0,
};
+#endif
static const struct of_device_id fsl_of_msi_ids[] = {
{
--
2.39.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 01/34] powerpc/fsl-soc: hide unused const variable
2024-04-03 8:06 ` [PATCH 01/34] powerpc/fsl-soc: hide unused const variable Arnd Bergmann
@ 2024-04-03 8:19 ` Christophe Leroy
0 siblings, 0 replies; 7+ messages in thread
From: Christophe Leroy @ 2024-04-03 8:19 UTC (permalink / raw)
To: Arnd Bergmann, linux-kernel@vger.kernel.org, Michael Ellerman,
Alexander Graf, Stuart Yoder, Scott Wood
Cc: Rob Herring, Arnd Bergmann, Nicholas Piggin, Aneesh Kumar K.V,
Uwe Kleine-König, Naveen N. Rao,
linuxppc-dev@lists.ozlabs.org
Le 03/04/2024 à 10:06, Arnd Bergmann a écrit :
> From: Arnd Bergmann <arnd@arndb.de>
>
> vmpic_msi_feature is only used conditionally, which triggers a rare
> -Werror=unused-const-variable= warning with gcc:
>
> arch/powerpc/sysdev/fsl_msi.c:567:37: error: 'vmpic_msi_feature' defined but not used [-Werror=unused-const-variable=]
> 567 | static const struct fsl_msi_feature vmpic_msi_feature =
>
> Hide this one in the same #ifdef as the reference so we can turn on
> the warning by default.
>
> Fixes: 305bcf26128e ("powerpc/fsl-soc: use CONFIG_EPAPR_PARAVIRT for hcalls")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> arch/powerpc/sysdev/fsl_msi.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
> index 8e6c84df4ca1..e205135ae1fe 100644
> --- a/arch/powerpc/sysdev/fsl_msi.c
> +++ b/arch/powerpc/sysdev/fsl_msi.c
> @@ -564,10 +564,12 @@ static const struct fsl_msi_feature ipic_msi_feature = {
> .msiir_offset = 0x38,
> };
>
> +#ifdef CONFIG_EPAPR_PARAVIRT
> static const struct fsl_msi_feature vmpic_msi_feature = {
> .fsl_pic_ip = FSL_PIC_IP_VMPIC,
> .msiir_offset = 0,
> };
> +#endif
>
> static const struct of_device_id fsl_of_msi_ids[] = {
> {
^ permalink raw reply [flat|nested] 7+ 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 01/34] powerpc/fsl-soc: hide unused const variable 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; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-06 5:20 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Shyam-sundar.S-k, heiko, rafael, dri-devel, benjamin.tissoires,
srinivas.pandruvada, hch, linux-samsung-soc, linux-pm,
linux-sound, abbotti, linux-omap, trond.myklebust, elder, kristo,
chenxiang66, gregkh, linux-usb, linux-wireless, linux-kernel,
linux-spi, hsweeten, iyappan, linux-crypto, akpm,
linux-trace-kernel, linux-hardening, alexandre.belloni,
markuss.broks, hvaibhav.linux, linux-i2c, lars, minyard, deller,
lee, linux-clk, linux-rockchip, iommu
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] 7+ 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 01/34] powerpc/fsl-soc: hide unused const variable 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; 7+ messages in thread
From: Sebastian Reichel @ 2024-04-10 8:02 UTC (permalink / raw)
To: linux-kernel, Arnd Bergmann
Cc: Shyam Sundar S K, Heiko Stuebner, Rafael J. Wysocki, dri-devel,
Benjamin Tissoires, Srinivas Pandruvada, Christoph Hellwig,
linux-samsung-soc, linux-pm, linux-sound, Ian Abbott, linux-omap,
Trond Myklebust, Alex Elder, Tero Kristo, Xiang Chen,
Greg Kroah-Hartman, linux-usb, linux-wireless, linux-spi,
H Hartley Sweeten, Iyappan Subramanian, linux-crypto,
Andrew Morton, linux-trace-kernel, linux-hardening,
Alexandre Be lloni, Markuss Broks, Vaibhav Hiremath, linux-i2c,
Lars-Peter Clausen, Corey Minyard, Helge Deller, Lee Jones,
linux-clk, linux-rockchip, iommu, Yisen Zhuang, Len Brown,
Andi Shyti, Michael Hennerich, linux-kbuild, linux-arm-msm,
greybus-dev, linux-amlogic, linux-arm-kernel, Neil Armstrong,
Stephen Boyd, Jarkko Sakkinen, Anna Schumaker, linux-integrity,
alsa-devel, Jonathan Cameron, linux-efi, linux-iio, linux-fpga,
linux-fbdev, kasan-dev, Jiri Slaby, linux-rtc, Stanislaw Gruszka,
Masahiro Yamada, linux-staging, linux-input, Jacky Huang,
Kees Cook, Arnd Bergmann, Jiri Kosina, Robin Murphy,
Steven Rostedt, Nathan Chancellor, Mark Brown, Moritz Fischer,
openipmi-developer, linux-nfs, Martin K. Petersen,
Dmitry Torokhov, Sebastian Reichel, Peter Rosin, linux-stm32,
Tony Lindgren, Liviu Dudau, Alexandre Torgue, linux-ide
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] 7+ 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; 7+ messages in thread
From: Michael Ellerman @ 2024-04-22 8:16 UTC (permalink / raw)
To: linux-kernel, Arnd Bergmann
Cc: Shyam Sundar S K, Heiko Stuebner, Rafael J. Wysocki, dri-devel,
Benjamin Tissoires, Srinivas Pandruvada, Christoph Hellwig,
linux-samsung-soc, g.com, linux-pm, linux-sound, Ian Abbott,
linux-omap, Trond Myklebust, Alex Elder, Tero Kristo, Xiang Chen,
Greg Kroah-Hartman, linux-usb, linux-wireless, linux-spi,
H Hartley Sweeten, Iyappan Subramanian, linux-crypto,
Andrew Morton, linux-trace-kernel, linux-hardening,
Alexandre Belloni, Markuss Broks, Vaibhav Hiremath, linux-i2c,
Lars-Peter Clausen, Helge Deller, Lee Jones, linux-clk,
linux-rockchip, iommu, Yisen Zhuang, Len Brown, Andi Shyti,
Corey Minyard, linux-kbuild, linux-arm-msm, Michael Hennerich,
greybus-dev, org, linux-arm-kernel, Neil Armstrong, Stephen Boyd,
Jarkko Sakkinen, Anna Schumaker, linux-integrity, alsa-devel,
Jonathan Cameron, linux-efi, linux-iio, linux-fpga, linux-fbdev,
kasan-dev, linux-amlogic, linux-rtc, Stanislaw Gruszka,
Masahiro Yamada, linux-staging, Jiri Slaby, Jacky Huang,
Kees Cook, Arnd Bergmann, linux-input, Steven Rostedt,
Nathan Chancellor, Mark Brown, Moritz Fischer, openipmi-developer,
linux-nfs, Martin K. Petersen, Dmitry Torokhov, Sebastian Reichel,
netdev, Peter Rosin, Tony Lindgren, Liviu Dudau, Alexandre Torgue,
linux-ide, Peter Huewe, Ard Biesheuvel, linux-leds, Herbert Xu,
linux-scsi, Vinod Koul, linux-stm32, linux-serial, Jakub Kicinski,
Masami Hiramatsu, Jiri Kosina, Kalle Valo, John Allen, eply.com,
Robin Murphy, Bjorn Andersson, Takashi Iwai, Krzysztof Kozlowski,
Damien Le Moal, dmaengine, linuxppc-dev
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] 7+ 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; 7+ 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] 7+ messages in thread