Skip to content

address all -Wunused-const warnings

Arnd Bergmann alsa-devel dmaengine dri-devel linux-amlogic linux-arm-kernel linux-arm-msm linux-clk linux-crypto linux-efi linux-fbdev linux-fpga linux-hardening linux-i2c linux-ide linux-iio linux-input linux-integrity linux-iommu linux-kbuild linux-leds linux-nfs linux-omap linux-pm linux-rockchip linux-rtc linux-samsung-soc linux-scsi linux-serial linux-sound linux-spi linux-staging linux-trace-kernel linux-usb linux-wireless linuxppc-dev lkml netdev 1 version Applied

Status from this message: applied to fbdev git tree.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest34 patches 65 repliesApplied 3/34

Patches in v1 Applied · 3/34

#Subject and filesSizeRepliesApplied
1/34powerpc/fsl-soc: hide unused const variablearch/powerpc/sysdev/fsl_msi.c+2 -01 reply
2/34ubsan: fix unused variable warning in test modulelib/test_ubsan.c+1 -11 reply
3/34platform: goldfish: remove ACPI_PTR() annotationsdrivers/platform/goldfish/goldfish_pipe.c+1 -11 reply
4/34i2c: pxa: hide unused icr_bits[] variabledrivers/i2c/busses/i2c-pxa.c+1 -11 reply
5/343c515: remove unused 'mtu' variabledrivers/net/ethernet/3com/3c515.c+0 -30 repliesApplied
6/34tracing: hide unused ftrace_event_id_fopskernel/trace/trace_events.c+4 -00 replies
7/34Input: stmpe-ts - mark OF related data as maybe unuseddrivers/input/touchscreen/stmpe-ts.c+1 -16 replies
8/34Input: synaptics: hide unused smbus_pnp_ids[] arraydrivers/input/mouse/synaptics.c+2 -00 replies
9/34power: rt9455: hide unused rt9455_boost_voltage_valuesdrivers/power/supply/rt9455_charger.c+2 -00 replies
10/34efi: sysfb: don't build when EFI is disableddrivers/firmware/efi/Makefile drivers/firmware/efi/sysfb_efi.c+2 -32 replies
11/34clk: ti: dpll: fix incorrect #ifdef checksdrivers/clk/ti/dpll.c+4 -62 replies
12/34apm-emulation: hide an unused variabledrivers/char/apm-emulation.c+2 -31 reply
13/34sisfb: hide unused variablesdrivers/video/fbdev/sis/init301.c+1 -21 reply
14/34dma/congiguous: avoid warning about unused size_byteskernel/dma/contiguous.c+1 -11 reply
15/34leds: apu: remove duplicate DMI lookup datadrivers/leds/leds-apu.c+1 -21 reply
16/34iio: ad5755: hook up of_device_id lookup to platform driverdrivers/iio/dac/ad5755.c+1 -05 replies
17/34greybus: arche-ctrl: move device table to its right locationdrivers/staging/greybus/arche-apb-ctrl.c drivers/staging/greybus/arche-platform.c+2 -81 reply
18/34lib: checksum: hide unused expected_csum_ipv6_magic[]lib/checksum_kunit.c+2 -04 replies
19/34sunrpc: suppress warnings for unused procfs functionsnet/sunrpc/cache.c+3 -72 replies
20/34comedi: ni_atmio: avoid warning for unused device_ids[] tabledrivers/comedi/drivers/ni_atmio.c+1 -10 replies
21/34iwlegacy: don't warn for unused variables with DEBUG_FS=ndrivers/net/wireless/intel/iwlegacy/4965-rs.c drivers/net/wireless/intel/iwlegacy/common.h+2 -152 replies
22/34drm/komeda: don't warn for unused debugfs filesdrivers/gpu/drm/arm/display/komeda/komeda_dev.c+0 -80 replies
23/34firmware: qcom_scm: mark qcom_scm_qseecom_allowlist as __maybe_unuseddrivers/firmware/qcom/qcom_scm.c+1 -11 reply
24/34crypto: ccp - drop platform ifdef checksdrivers/crypto/ccp/sp-platform.c+2 -123 replies
25/34usb: gadget: omap_udc: remove unused variabledrivers/usb/gadget/udc/omap_udc.c+3 -71 reply
26/34isdn: kcapi: don't build unused procfs codedrivers/isdn/capi/Makefile drivers/isdn/capi/kcapi.c+7 -30 repliesApplied
27/34cpufreq: intel_pstate: hide unused intel_pstate_cpu_oob_ids[]drivers/cpufreq/intel_pstate.c+2 -01 reply
28/34net: xgbe: remove extraneous #ifdef checksdrivers/net/ethernet/amd/xgbe/xgbe-platform.c+0 -80 repliesApplied
29/34Input: imagis - remove incorrect ifdef checksdrivers/input/touchscreen/imagis.c+1 -30 replies
30/34sata: mv: drop unnecessary #ifdef checksdrivers/ata/sata_mv.c+32 -325 replies
31/34spi: remove incorrect of_match_ptr annotationsdrivers/spi/spi-armada-3700.c drivers/spi/spi-img-spfi.c drivers/spi/spi-meson-spicc.c +7 more+10 -106 replies
32/34ASoC: remove incorrect of_match_ptr/ACPI_PTR annotationssound/soc/amd/acp3x-rt5682-max9836.c sound/soc/atmel/sam9x5_wm8731.c sound/soc/codecs/rt5514-spi.c +2 more+5 -52 replies
33/34drivers: remove incorrect of_match_ptr/ACPI_PTR annotationsdrivers/char/ipmi/ipmb_dev_int.c drivers/char/tpm/tpm_ftpm_tee.c drivers/dma/img-mdc-dma.c +17 more+23 -259 replies
34/34kbuild: always enable -Wunused-const-variablescripts/Makefile.extrawarn+0 -12 replies

Reviews trailers per patch

13 of 34 patches have a Reviewed-by or Acked-by.

PatchChristophe LeroyJeff LaytonTony LindgrenAndy ShevchenkoJiri KosinaCorey MinyardArd BiesheuvelJavier Martinez CanillasChuck LeverTom LendackyJarkko SakkinenAaro KoskinenGreg Kroah-HartmanXu YilunPeter RosinAlex Elder
1/34R-b
2/34
3/34R-b
4/34
5/34
6/34
7/34
8/34
9/34
10/34A-b A-b
11/34R-b
12/34A-b
13/34
14/34
15/34
16/34R-b
17/34R-b
18/34
19/34R-b A-b
20/34
21/34
22/34
23/34
24/34A-b
25/34A-b
26/34
27/34
28/34
29/34
30/34
31/34R-b
32/34R-b
33/34R-b A-b R-b A-b A-b A-b
34/34

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 16 reviewers.

Read the v1 thread

Cover letter [PATCH 00/34] address all -Wunused-const warnings

From: Arnd Bergmann <[email protected]>

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

Arnd Bergmann (31):
powerpc/fsl-soc: hide unused const variable
ubsan: fix unused variable warning in test module
platform: goldfish: remove ACPI_PTR() annotations
i2c: pxa: hide unused icr_bits[] variable
3c515: remove unused 'mtu' variable
tracing: hide unused ftrace_event_id_fops
Input: synaptics: hide unused smbus_pnp_ids[] array
power: rt9455: hide unused rt9455_boost_voltage_values
efi: sysfb: don't build when EFI is disabled
clk: ti: dpll: fix incorrect #ifdef checks
apm-emulation: hide an unused variable
sisfb: hide unused variables
dma/congiguous: avoid warning about unused size_bytes
leds: apu: remove duplicate DMI lookup data
iio: ad5755: hook up of_device_id lookup to platform driver
greybus: arche-ctrl: move device table to its right location
lib: checksum: hide unused expected_csum_ipv6_magic[]
sunrpc: suppress warnings for unused procfs functions
comedi: ni_atmio: avoid warning for unused device_ids[] table
iwlegacy: don't warn for unused variables with DEBUG_FS=n drm/komeda: don't warn for unused debugfs files
firmware: qcom_scm: mark qcom_scm_qseecom_allowlist as __maybe_unused
crypto: ccp - drop platform ifdef checks
usb: gadget: omap_udc: remove unused variable
isdn: kcapi: don't build unused procfs code
cpufreq: intel_pstate: hide unused intel_pstate_cpu_oob_ids[]
net: xgbe: remove extraneous #ifdef checks
Input: imagis - remove incorrect ifdef checks
sata: mv: drop unnecessary #ifdef checks
ASoC: remove incorrect of_match_ptr/ACPI_PTR annotations
spi: remove incorrect of_match_ptr annotations
drivers: remove incorrect of_match_ptr/ACPI_PTR annotations
kbuild: always enable -Wunused-const-variable

Krzysztof Kozlowski (1):
Input: stmpe-ts - mark OF related data as maybe unused

 arch/powerpc/sysdev/fsl_msi.c                 |  2 +
 drivers/ata/sata_mv.c                         | 64 +++++++++----------
 drivers/char/apm-emulation.c                  |  5 +-
 drivers/char/ipmi/ipmb_dev_int.c              |  2 +-
 drivers/char/tpm/tpm_ftpm_tee.c               |  2 +-
 drivers/clk/ti/dpll.c                         | 10 ++-
 drivers/comedi/drivers/ni_atmio.c             |  2 +-
 drivers/cpufreq/intel_pstate.c                |  2 +
 drivers/crypto/ccp/sp-platform.c              | 14 +---
 drivers/dma/img-mdc-dma.c                     |  2 +-
 drivers/firmware/efi/Makefile                 |  3 +-
 drivers/firmware/efi/sysfb_efi.c              |  2 -
 drivers/firmware/qcom/qcom_scm.c              |  2 +-
 drivers/fpga/versal-fpga.c                    |  2 +-
 .../gpu/drm/arm/display/komeda/komeda_dev.c   |  8 ---
 drivers/hid/hid-google-hammer.c               |  6 +-
 drivers/i2c/busses/i2c-pxa.c                  |  2 +-
 drivers/i2c/muxes/i2c-mux-ltc4306.c           |  2 +-
 drivers/i2c/muxes/i2c-mux-reg.c               |  2 +-
 drivers/iio/dac/ad5755.c                      |  1 +
 drivers/input/mouse/synaptics.c               |  2 +
 drivers/input/touchscreen/imagis.c            |  4 +-
 drivers/input/touchscreen/stmpe-ts.c          |  2 +-
 drivers/input/touchscreen/wdt87xx_i2c.c       |  2 +-
 drivers/isdn/capi/Makefile                    |  3 +-
 drivers/isdn/capi/kcapi.c                     |  7 +-
 drivers/leds/leds-apu.c                       |  3 +-
 drivers/mux/adg792a.c                         |  2 +-
 drivers/net/ethernet/3com/3c515.c             |  3 -
 drivers/net/ethernet/amd/xgbe/xgbe-platform.c |  8 ---
 drivers/net/ethernet/apm/xgene-v2/main.c      |  2 +-
 drivers/net/ethernet/hisilicon/hns_mdio.c     |  2 +-
 drivers/net/wireless/intel/iwlegacy/4965-rs.c | 15 +----
 drivers/net/wireless/intel/iwlegacy/common.h  |  2 -
 drivers/platform/goldfish/goldfish_pipe.c     |  2 +-
 drivers/power/supply/rt9455_charger.c         |  2 +
 drivers/regulator/pbias-regulator.c           |  2 +-
 drivers/regulator/twl-regulator.c             |  2 +-
 drivers/regulator/twl6030-regulator.c         |  2 +-
 drivers/rtc/rtc-fsl-ftm-alarm.c               |  2 +-
 drivers/scsi/hisi_sas/hisi_sas_v1_hw.c        |  2 +-
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c        |  2 +-
 drivers/spi/spi-armada-3700.c                 |  2 +-
 drivers/spi/spi-img-spfi.c                    |  2 +-
 drivers/spi/spi-meson-spicc.c                 |  2 +-
 drivers/spi/spi-meson-spifc.c                 |  2 +-
 drivers/spi/spi-orion.c                       |  2 +-
 drivers/spi/spi-pic32-sqi.c                   |  2 +-
 drivers/spi/spi-pic32.c                       |  2 +-
 drivers/spi/spi-rockchip.c                    |  2 +-
 drivers/spi/spi-s3c64xx.c                     |  2 +-
 drivers/spi/spi-st-ssc4.c                     |  2 +-
 drivers/staging/greybus/arche-apb-ctrl.c      |  1 +
 drivers/staging/greybus/arche-platform.c      |  9 +--
 drivers/staging/pi433/pi433_if.c              |  2 +-
 drivers/tty/serial/amba-pl011.c               |  6 +-
 drivers/tty/serial/ma35d1_serial.c            |  2 +-
 drivers/usb/gadget/udc/omap_udc.c             | 10 +--
 drivers/video/fbdev/sis/init301.c             |  3 +-
 kernel/dma/contiguous.c                       |  2 +-
 kernel/trace/trace_events.c                   |  4 ++
 lib/checksum_kunit.c                          |  2 +
 lib/test_ubsan.c                              |  2 +-
 net/sunrpc/cache.c                            | 10 +--
 scripts/Makefile.extrawarn                    |  1 -
 sound/soc/atmel/sam9x5_wm8731.c               |  2 +-
 sound/soc/codecs/rt5514-spi.c                 |  2 +-
 sound/soc/qcom/lpass-sc7280.c                 |  2 +-
 sound/soc/samsung/aries_wm8994.c              |  2 +-
 69 files changed, 121 insertions(+), 169 deletions(-)
Signature · 106 lines
2.39.2

Cc: Michael Ellerman <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: Damien Le Moal <[email protected]>
Cc: Jiri Kosina <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Corey Minyard <[email protected]>
Cc: Peter Huewe <[email protected]>
Cc: Jarkko Sakkinen <[email protected]>
Cc: Tero Kristo <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Cc: Srinivas Pandruvada <[email protected]>
Cc: Len Brown <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: John Allen <[email protected]>
Cc: Herbert Xu <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Bjorn Andersson <[email protected]>
Cc: Moritz Fischer <[email protected]>
Cc: Liviu Dudau <[email protected]>
Cc: Benjamin Tissoires <[email protected]>
Cc: Andi Shyti <[email protected]>
Cc: Michael Hennerich <[email protected]>
Cc: Peter Rosin <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Markuss Broks <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Shyam Sundar S K <[email protected]>
Cc: Iyappan Subramanian <[email protected]>
Cc: Yisen Zhuang <[email protected]>
Cc: Stanislaw Gruszka <[email protected]>
Cc: Kalle Valo <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Xiang Chen <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Heiko Stuebner <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Vaibhav Hiremath <[email protected]>
Cc: Alex Elder <[email protected]>
Cc: Jiri Slaby <[email protected]>
Cc: Jacky Huang <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Robin Murphy <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Masahiro Yamada <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]