From: Corey Minyard <minyard@acm.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Arnd Bergmann" <arnd@kernel.org>,
linux-kernel@vger.kernel.org, "Peter Huewe" <peterhuewe@gmx.de>,
"Jarkko Sakkinen" <jarkko@kernel.org>,
"Vinod Koul" <vkoul@kernel.org>,
"Moritz Fischer" <mdf@kernel.org>, "Wu Hao" <hao.wu@intel.com>,
"Xu Yilun" <yilun.xu@intel.com>, "Jiri Kosina" <jikos@kernel.org>,
"Benjamin Tissoires" <benjamin.tissoires@redhat.com>,
"Michael Hennerich" <michael.hennerich@analog.com>,
"Peter Rosin" <peda@axentia.se>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Iyappan Subramanian" <iyappan@os.amperecomputing.com>,
"Keyur Chudgar" <keyur@os.amperecomputing.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Yisen Zhuang" <yisen.zhuang@huawei.com>,
"Salil Mehta" <salil.mehta@huawei.com>,
"Tony Lindgren" <tony@atomide.com>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Xiang Chen" <chenxiang66@hisilicon.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Russell King" <linux@armlinux.org.uk>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Jacky Huang" <ychuang3@nuvoton.com>,
"Shan-Chun Hung" <schung@nuvoton.com>,
"Arnd Bergmann" <arnd@arndb.de>, "Jason Gunthorpe" <jgg@ziepe.ca>,
"Tom Rix" <trix@redhat.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Rob Herring" <robh@kernel.org>,
"Linus Walleij" <linus.walleij@linaro.org>,
openipmi-developer@lists.sourceforge.net,
linux-integrity@vger.kernel.org, dmaengine@vger.kernel.org,
linux-fpga@vger.kernel.org, linux-input@vger.kernel.org,
linux-i2c@vger.kernel.org, netdev@vger.kernel.org,
linux-omap@vger.kernel.org, linux-rtc@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-staging@lists.linux.dev,
linux-serial@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 33/34] drivers: remove incorrect of_match_ptr/ACPI_PTR annotations
Date: Wed, 3 Apr 2024 07:47:49 -0500 [thread overview]
Message-ID: <Zg1P9fpdwPot3Dxj@mail.minyard.net> (raw)
In-Reply-To: <Zg0hxMZGlwfXV2RA@smile.fi.intel.com>
On Wed, Apr 03, 2024 at 12:30:44PM +0300, Andy Shevchenko wrote:
> On Wed, Apr 03, 2024 at 10:06:51AM +0200, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > When building with CONFIG_OF and/or CONFIG_ACPI disabled but W=1 extra
> > warnings enabled, a lot of driver cause a warning about an unused
> > ID table:
> >
> > drivers/char/tpm/tpm_ftpm_tee.c:356:34: error: unused variable 'of_ftpm_tee_ids' [-Werror,-Wunused-const-variable]
> > drivers/dma/img-mdc-dma.c:863:34: error: unused variable 'mdc_dma_of_match' [-Werror,-Wunused-const-variable]
> > drivers/fpga/versal-fpga.c:62:34: error: unused variable 'versal_fpga_of_match' [-Werror,-Wunused-const-variable]
> > drivers/i2c/muxes/i2c-mux-ltc4306.c:200:34: error: unused variable 'ltc4306_of_match' [-Werror,-Wunused-const-variable]
> > drivers/i2c/muxes/i2c-mux-reg.c:242:34: error: unused variable 'i2c_mux_reg_of_match' [-Werror,-Wunused-const-variable]
> > drivers/memory/pl353-smc.c:62:34: error: unused variable 'pl353_smc_supported_children' [-Werror,-Wunused-const-variable]
> > drivers/regulator/pbias-regulator.c:136:34: error: unused variable 'pbias_of_match' [-Werror,-Wunused-const-variable]
> > drivers/regulator/twl-regulator.c:552:34: error: unused variable 'twl_of_match' [-Werror,-Wunused-const-variable]
> > drivers/regulator/twl6030-regulator.c:645:34: error: unused variable 'twl_of_match' [-Werror,-Wunused-const-variable]
> > drivers/scsi/hisi_sas/hisi_sas_v2_hw.c:3635:36: error: unused variable 'sas_v2_acpi_match' [-Werror,-Wunused-const-variable]
> > drivers/staging/pi433/pi433_if.c:1359:34: error: unused variable 'pi433_dt_ids' [-Werror,-Wunused-const-variable]
> > drivers/tty/serial/amba-pl011.c:2945:34: error: unused variable 'sbsa_uart_of_match' [-Werror,-Wunused-const-variable]
> >
> > The fix is always to just remove the of_match_ptr() and ACPI_PTR() wrappers
> > that remove the reference, rather than adding another #ifdef just for build
> > testing for a configuration that doesn't matter in practice.
>
> > I considered splitting up the large patch into per subsystem patches, but since
> > it's really just the same thing everywhere it feels better to do it all at once.
>
> Can we split to three groups:
> - Dropping ACPI_PTR()
> - Dropping of_match_ptr() (which I won't review in depth, for example)
> - Dropping both
> ?
Why?
-corey
>
> ...
>
> > --- a/drivers/char/ipmi/ipmb_dev_int.c
> > +++ b/drivers/char/ipmi/ipmb_dev_int.c
> > @@ -364,7 +364,7 @@ MODULE_DEVICE_TABLE(acpi, acpi_ipmb_id);
> > static struct i2c_driver ipmb_driver = {
> > .driver = {
> > .name = "ipmb-dev",
> > - .acpi_match_table = ACPI_PTR(acpi_ipmb_id),
> > + .acpi_match_table = acpi_ipmb_id,
> > },
> > .probe = ipmb_probe,
> > .remove = ipmb_remove,
>
> acpi.h --> mod_devicetable.h.
>
> ...
>
> > --- a/drivers/hid/hid-google-hammer.c
> > +++ b/drivers/hid/hid-google-hammer.c
> > @@ -275,21 +275,19 @@ static const struct acpi_device_id cbas_ec_acpi_ids[] = {
> > };
> > MODULE_DEVICE_TABLE(acpi, cbas_ec_acpi_ids);
> >
> > -#ifdef CONFIG_OF
> > static const struct of_device_id cbas_ec_of_match[] = {
> > { .compatible = "google,cros-cbas" },
> > { },
> > };
> > MODULE_DEVICE_TABLE(of, cbas_ec_of_match);
> > -#endif
> >
> > static struct platform_driver cbas_ec_driver = {
> > .probe = cbas_ec_probe,
> > .remove = cbas_ec_remove,
> > .driver = {
> > .name = "cbas_ec",
> > - .acpi_match_table = ACPI_PTR(cbas_ec_acpi_ids),
> > - .of_match_table = of_match_ptr(cbas_ec_of_match),
> > + .acpi_match_table = cbas_ec_acpi_ids,
> > + .of_match_table = cbas_ec_of_match,
> > .pm = &cbas_ec_pm_ops,
> > },
> > };
>
> Ditto, and likely of.h can be also dropped.
>
> ...
>
> > --- a/drivers/input/touchscreen/wdt87xx_i2c.c
> > +++ b/drivers/input/touchscreen/wdt87xx_i2c.c
> > @@ -1166,7 +1166,7 @@ static struct i2c_driver wdt87xx_driver = {
> > .name = WDT87XX_NAME,
> > .dev_groups = wdt87xx_groups,
> > .pm = pm_sleep_ptr(&wdt87xx_pm_ops),
> > - .acpi_match_table = ACPI_PTR(wdt87xx_acpi_id),
> > + .acpi_match_table = wdt87xx_acpi_id,
> > },
> > };
> > module_i2c_driver(wdt87xx_driver);
>
> Ditto.
>
> ...
>
> > --- a/drivers/net/ethernet/apm/xgene-v2/main.c
> > +++ b/drivers/net/ethernet/apm/xgene-v2/main.c
> > @@ -731,7 +731,7 @@ MODULE_DEVICE_TABLE(acpi, xge_acpi_match);
> > static struct platform_driver xge_driver = {
> > .driver = {
> > .name = "xgene-enet-v2",
> > - .acpi_match_table = ACPI_PTR(xge_acpi_match),
> > + .acpi_match_table = xge_acpi_match,
> > },
> > .probe = xge_probe,
> > .remove_new = xge_remove,
>
> Ditto. And remove forward declaration of the variable as well.
>
> ...
>
> > --- a/drivers/rtc/rtc-fsl-ftm-alarm.c
> > +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
> > @@ -320,7 +320,7 @@ static struct platform_driver ftm_rtc_driver = {
> > .driver = {
> > .name = "ftm-alarm",
> > .of_match_table = ftm_rtc_match,
> > - .acpi_match_table = ACPI_PTR(ftm_imx_acpi_ids),
> > + .acpi_match_table = ftm_imx_acpi_ids,
> > },
> > };
>
> Ditto.
>
> ...
>
> > .driver = {
> > .name = "pi433",
> > .owner = THIS_MODULE,
>
> Oh-oh.
>
> > - .of_match_table = of_match_ptr(pi433_dt_ids),
> > + .of_match_table = pi433_dt_ids,
> > },
>
> ...
>
> > --- a/drivers/tty/serial/amba-pl011.c
> > +++ b/drivers/tty/serial/amba-pl011.c
> > @@ -2948,7 +2948,7 @@ static const struct of_device_id sbsa_uart_of_match[] = {
> > };
> > MODULE_DEVICE_TABLE(of, sbsa_uart_of_match);
> >
> > -static const struct acpi_device_id __maybe_unused sbsa_uart_acpi_match[] = {
> > +static const struct acpi_device_id sbsa_uart_acpi_match[] = {
> > { "ARMH0011", 0 },
> > { "ARMHB000", 0 },
> > {},
> > @@ -2961,8 +2961,8 @@ static struct platform_driver arm_sbsa_uart_platform_driver = {
> > .driver = {
> > .name = "sbsa-uart",
> > .pm = &pl011_dev_pm_ops,
> > - .of_match_table = of_match_ptr(sbsa_uart_of_match),
> > - .acpi_match_table = ACPI_PTR(sbsa_uart_acpi_match),
> > + .of_match_table = sbsa_uart_of_match,
> > + .acpi_match_table = sbsa_uart_acpi_match,
> > .suppress_bind_attrs = IS_BUILTIN(CONFIG_SERIAL_AMBA_PL011),
> > },
> > };
>
> Ditto.
>
> ...
>
> As mentioned above, I haven't and won't look into of_match_ptr() cases, but you
> got the idea.
>
> For the above, if addressed as suggested,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
next prev parent reply other threads:[~2024-04-03 12:47 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
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-03 8:19 ` Christophe Leroy
2024-04-03 8:06 ` [PATCH 02/34] ubsan: fix unused variable warning in test module Arnd Bergmann
2024-04-03 21:36 ` (subset) " Kees Cook
2024-04-03 8:06 ` [PATCH 03/34] platform: goldfish: remove ACPI_PTR() annotations Arnd Bergmann
2024-04-03 9:08 ` Andy Shevchenko
2024-04-03 8:06 ` [PATCH 04/34] i2c: pxa: hide unused icr_bits[] variable Arnd Bergmann
2024-04-03 23:17 ` Andi Shyti
2024-04-03 8:06 ` [PATCH 05/34] 3c515: remove unused 'mtu' variable Arnd Bergmann
2024-04-03 8:06 ` [PATCH 06/34] tracing: hide unused ftrace_event_id_fops Arnd Bergmann
2024-04-03 8:06 ` [PATCH 07/34] Input: stmpe-ts - mark OF related data as maybe unused Arnd Bergmann
2024-04-03 9:40 ` Andy Shevchenko
2024-04-03 9:52 ` Krzysztof Kozlowski
2024-04-03 10:03 ` Andy Shevchenko
2024-04-03 10:10 ` Krzysztof Kozlowski
2024-04-03 13:17 ` Uwe Kleine-König
2024-04-03 13:27 ` Uwe Kleine-König
2024-04-03 8:06 ` [PATCH 08/34] Input: synaptics: hide unused smbus_pnp_ids[] array Arnd Bergmann
2024-04-03 8:06 ` [PATCH 09/34] power: rt9455: hide unused rt9455_boost_voltage_values Arnd Bergmann
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
2024-04-03 8:06 ` [PATCH 11/34] clk: ti: dpll: fix incorrect #ifdef checks Arnd Bergmann
2024-04-03 9:00 ` Tony Lindgren
2024-04-05 21:13 ` Stephen Boyd
2024-04-03 8:06 ` [PATCH 12/34] apm-emulation: hide an unused variable Arnd Bergmann
2024-04-03 12:23 ` Jiri Kosina
2024-04-03 8:06 ` [PATCH 13/34] sisfb: hide unused variables Arnd Bergmann
2024-04-03 12:39 ` Helge Deller
2024-04-03 8:06 ` [PATCH 14/34] dma/congiguous: avoid warning about unused size_bytes Arnd Bergmann
2024-04-03 9:42 ` Christoph Hellwig
2024-04-03 8:06 ` [PATCH 15/34] leds: apu: remove duplicate DMI lookup data Arnd Bergmann
2024-04-11 15:51 ` (subset) " Lee Jones
2024-04-03 8:06 ` [PATCH 16/34] iio: ad5755: hook up of_device_id lookup to platform driver Arnd Bergmann
2024-04-03 9:36 ` Andy Shevchenko
2024-04-03 9:55 ` Krzysztof Kozlowski
2024-04-03 10:01 ` Arnd Bergmann
2024-04-06 15:30 ` Jonathan Cameron
2024-04-06 15:31 ` Jonathan Cameron
2024-04-03 8:06 ` [PATCH 17/34] greybus: arche-ctrl: move device table to its right location Arnd Bergmann
2024-04-30 23:41 ` Alex Elder
2024-04-03 8:06 ` [PATCH 18/34] lib: checksum: hide unused expected_csum_ipv6_magic[] Arnd Bergmann
2024-04-03 8:41 ` Christophe Leroy
2024-04-03 8:58 ` Arnd Bergmann
2024-04-03 9:03 ` Christophe Leroy
2024-04-04 11:43 ` Arnd Bergmann
2024-04-03 8:06 ` [PATCH 19/34] sunrpc: suppress warnings for unused procfs functions Arnd Bergmann
2024-04-03 8:59 ` Jeff Layton
2024-04-03 13:20 ` Chuck Lever
2024-04-03 8:06 ` [PATCH 20/34] comedi: ni_atmio: avoid warning for unused device_ids[] table Arnd Bergmann
2024-04-03 8:06 ` [PATCH 21/34] iwlegacy: don't warn for unused variables with DEBUG_FS=n Arnd Bergmann
2024-04-03 9:33 ` Andy Shevchenko
2024-04-03 14:26 ` Jeff Johnson
2024-04-03 8:06 ` [PATCH 22/34] drm/komeda: don't warn for unused debugfs files Arnd Bergmann
2024-04-03 8:06 ` [PATCH 23/34] firmware: qcom_scm: mark qcom_scm_qseecom_allowlist as __maybe_unused Arnd Bergmann
2024-04-03 9:31 ` Krzysztof Kozlowski
2024-04-03 8:06 ` [PATCH 24/34] crypto: ccp - drop platform ifdef checks Arnd Bergmann
2024-04-03 15:17 ` Tom Lendacky
2024-04-03 15:50 ` Arnd Bergmann
2024-04-12 7:30 ` Herbert Xu
2024-04-03 8:06 ` [PATCH 25/34] usb: gadget: omap_udc: remove unused variable Arnd Bergmann
2024-04-05 22:51 ` Aaro Koskinen
2024-04-03 8:06 ` [PATCH 26/34] isdn: kcapi: don't build unused procfs code Arnd Bergmann
2024-04-03 8:06 ` [PATCH 27/34] cpufreq: intel_pstate: hide unused intel_pstate_cpu_oob_ids[] Arnd Bergmann
2024-04-03 14:43 ` Rafael J. Wysocki
2024-04-03 8:06 ` [PATCH 28/34] net: xgbe: remove extraneous #ifdef checks Arnd Bergmann
2024-04-03 8:06 ` [PATCH 29/34] Input: imagis - remove incorrect ifdef checks Arnd Bergmann
2024-04-03 8:06 ` [PATCH 30/34] sata: mv: drop unnecessary #ifdef checks Arnd Bergmann
2024-04-03 8:29 ` Damien Le Moal
2024-04-03 8:32 ` Damien Le Moal
2024-04-03 8:50 ` Arnd Bergmann
2024-04-04 3:45 ` Damien Le Moal
2024-04-03 9:10 ` Andy Shevchenko
2024-04-03 8:06 ` [PATCH 31/34] spi: remove incorrect of_match_ptr annotations Arnd Bergmann
2024-04-03 9:04 ` Andy Shevchenko
2024-04-03 9:05 ` Krzysztof Kozlowski
2024-04-03 9:56 ` Mark Brown
2024-04-03 21:05 ` Uwe Kleine-König
2024-04-03 21:13 ` Andy Shevchenko
2024-04-03 22:19 ` Arnd Bergmann
2024-04-03 8:06 ` [PATCH 32/34] ASoC: remove incorrect of_match_ptr/ACPI_PTR annotations Arnd Bergmann
2024-04-03 9:06 ` Krzysztof Kozlowski
2024-04-03 9:15 ` Andy Shevchenko
2024-04-03 8:06 ` [PATCH 33/34] drivers: " Arnd Bergmann
2024-04-03 9:13 ` Krzysztof Kozlowski
2024-04-03 9:30 ` Andy Shevchenko
2024-04-03 12:47 ` Corey Minyard [this message]
2024-04-03 13:23 ` Andy Shevchenko
2024-04-03 12:47 ` Corey Minyard
2024-04-03 16:09 ` Jarkko Sakkinen
2024-04-09 13:48 ` Greg Kroah-Hartman
2024-04-23 7:33 ` Xu Yilun
2024-04-23 9:52 ` Peter Rosin
2024-04-03 8:06 ` [PATCH 34/34] kbuild: always enable -Wunused-const-variable Arnd Bergmann
2024-04-03 9:19 ` Andy Shevchenko
2024-04-03 9:26 ` Arnd Bergmann
2024-04-06 5:20 ` [PATCH 00/34] address all -Wunused-const warnings patchwork-bot+netdevbpf
2024-04-10 8:02 ` (subset) " Sebastian Reichel
2024-04-22 8:16 ` Michael Ellerman
2025-01-27 13:24 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zg1P9fpdwPot3Dxj@mail.minyard.net \
--to=minyard@acm.org \
--cc=alexandre.belloni@bootlin.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=benjamin.tissoires@redhat.com \
--cc=broonie@kernel.org \
--cc=chenxiang66@hisilicon.com \
--cc=davem@davemloft.net \
--cc=dmaengine@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=hao.wu@intel.com \
--cc=iyappan@os.amperecomputing.com \
--cc=jarkko@kernel.org \
--cc=jejb@linux.ibm.com \
--cc=jgg@ziepe.ca \
--cc=jikos@kernel.org \
--cc=jirislaby@kernel.org \
--cc=keyur@os.amperecomputing.com \
--cc=kuba@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux@armlinux.org.uk \
--cc=martin.petersen@oracle.com \
--cc=mdf@kernel.org \
--cc=michael.hennerich@analog.com \
--cc=netdev@vger.kernel.org \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=pabeni@redhat.com \
--cc=peda@axentia.se \
--cc=peterhuewe@gmx.de \
--cc=rdunlap@infradead.org \
--cc=robh@kernel.org \
--cc=salil.mehta@huawei.com \
--cc=schung@nuvoton.com \
--cc=tony@atomide.com \
--cc=trix@redhat.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=vkoul@kernel.org \
--cc=ychuang3@nuvoton.com \
--cc=yilun.xu@intel.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox