From patchwork Wed Apr 3 08:06:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 1919171 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=i9S2rWNS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V8fv15YB5z23tv for ; Wed, 3 Apr 2024 20:43:08 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=i9S2rWNS; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4V8ftz4jQ9z3d2B for ; Wed, 3 Apr 2024 20:43:07 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=i9S2rWNS; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=145.40.73.55; helo=sin.source.kernel.org; envelope-from=arnd@kernel.org; receiver=lists.ozlabs.org) Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4V8cmh33z9z30dn for ; Wed, 3 Apr 2024 19:07:32 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id A376DCE210F; Wed, 3 Apr 2024 08:07:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9555FC433C7; Wed, 3 Apr 2024 08:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712131648; bh=K2ePQOaggCQbp9MAuVhX6tyGJTkfITqYlV3FRyD1b2w=; h=From:To:Cc:Subject:Date:From; b=i9S2rWNSxBnVceX/PhEYHUL/8obuw7YBD3dJv3NpxgtqFmbZ6YmcytIk5F3iE5aJR I5RYRukVlaohxFlUlx3DoVo8ioTOKPq24ESuwErVo02d8QkqEyqWnOCLJPy3IIKQQU hPSJJJ28UFYnjJaOw9nBVZfRfW9z44J6zH3uuTF5it8w/Z071qPjEqTUM2WnMMrizN fO98GSAxPEoZV8r5mdONzcx9Bk+cWCKiyR3aI2XXY3Z1B5LcdC6almvWr6dDKTwDko dlyuak8JP+s7GrNn1iYACGO+Vywch0Qm7yXwZNXpNcwyBGG5wOlDd55NN/VlxGiFO6 vEIx/q6HxkU2Q== From: Arnd Bergmann To: linux-kernel@vger.kernel.org Subject: [PATCH 00/34] address all -Wunused-const warnings Date: Wed, 3 Apr 2024 10:06:18 +0200 Message-Id: <20240403080702.3509288-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 03 Apr 2024 20:42:54 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Shyam Sundar S K , Heiko Stuebner , "Rafael J. Wysocki" , dri-devel@lists.freedesktop.org, Benjamin Tissoires , Srinivas Pandruvada , Christoph Hellwig , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-sound@vger.kernel.org, Ian Abbott , linux-omap@vger.kernel.org, Trond Myklebust , Alex Elder , Tero Kristo , Xiang Chen , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-wireless@vger.kernel.org, linux-spi@vger.kernel.org, H Hartley Sweeten , Iyappan Subramanian , linux-crypto@vger.kernel.org, Andrew Morton , linux-trace-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Alexandre Be lloni , Markuss Broks , Vaibhav Hiremath , linux-i2c@vger.kernel.org, Lars-Peter Clausen , Corey Minyard , Helge Deller , Lee Jones , linux-clk@vger.kernel.org, linux-rockchip@lists.infradead.org, iommu@lists.linux.dev, Yisen Zhuang , Len Brown , Andi Shyti , Michael Hennerich , linux-kbuild@vger.kernel.org, linux-arm-msm@vger.kernel.org, greybus-dev@lists.linaro.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong , Stephen Boyd , Jarkko Sakkinen , Anna Schumaker , linux-integrity@vger.kernel.org, alsa-devel@alsa-project.org, Jonathan Cameron , linux-efi@vger.kernel.org, linux-iio@vger.kernel.org, linux-fpga @vger.kernel.org, linux-fbdev@vger.kernel.org, kasan-dev@googlegroups.com, Jiri Slaby , linux-rtc@vger.kernel.org, Stanislaw Gruszka , Masahiro Yamada , linux-staging@lists.linux.dev, linux-input@vger.kernel.org, Jacky Huang , Kees Cook , Arnd Bergmann , Jiri Kosina , Robin Murphy , Steven Rostedt , Nathan Chancellor , Mark Brown , Moritz Fischer , openipmi-developer@lists.sourceforge.net, linux-nfs@vger.kernel.org, "Martin K. Petersen" , Dmitry Torokhov , Sebastian Reichel , Peter Rosin , linux-stm32@st-md-mailman.stormreply.com, Tony Lindgren , Liviu Dudau , Alexandre Torgue , linux-ide@vger.kerne l.org, Peter Huewe , Ard Biesheuvel , linux-leds@vger.kernel.org, Herbert Xu , linux-scsi@vger.kernel.org, Vinod Koul , linux-serial@vger.kernel.org, Jakub Kicinski , Masami Hiramatsu , Kalle Valo , John Allen , netdev@vger.kernel.org, Bjorn Andersson , Takashi Iwai , Krzysztof Kozlowski , Damien Le Moal , dmaengine@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Arnd Bergmann 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(-)