* [PATCH 07/34] Input: stmpe-ts - mark OF related data as maybe unused [not found] <20240403080702.3509288-1-arnd@kernel.org> @ 2024-04-03 8:06 ` Arnd Bergmann 2024-04-03 9:40 ` Andy Shevchenko 2024-04-03 13:17 ` Uwe Kleine-König 2024-04-03 8:06 ` [PATCH 31/34] spi: remove incorrect of_match_ptr annotations Arnd Bergmann 2024-04-03 8:06 ` [PATCH 32/34] ASoC: remove incorrect of_match_ptr/ACPI_PTR annotations Arnd Bergmann 2 siblings, 2 replies; 17+ messages in thread From: Arnd Bergmann @ 2024-04-03 8:06 UTC (permalink / raw) To: linux-kernel, Dmitry Torokhov, Maxime Coquelin, Alexandre Torgue Cc: Krzysztof Kozlowski, Arnd Bergmann, Uwe Kleine-König, linux-input, linux-stm32, linux-arm-kernel From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> When compile tested with W=1 on x86_64 with driver as built-in: stmpe-ts.c:371:34: error: unused variable 'stmpe_ts_ids' [-Werror,-Wunused-const-variable] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/input/touchscreen/stmpe-ts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c index b204fdb2d22c..022b3e94266d 100644 --- a/drivers/input/touchscreen/stmpe-ts.c +++ b/drivers/input/touchscreen/stmpe-ts.c @@ -366,7 +366,7 @@ static struct platform_driver stmpe_ts_driver = { }; module_platform_driver(stmpe_ts_driver); -static const struct of_device_id stmpe_ts_ids[] = { +static const struct of_device_id stmpe_ts_ids[] __maybe_unused = { { .compatible = "st,stmpe-ts", }, { }, }; -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 07/34] Input: stmpe-ts - mark OF related data as maybe unused 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 13:17 ` Uwe Kleine-König 1 sibling, 1 reply; 17+ messages in thread From: Andy Shevchenko @ 2024-04-03 9:40 UTC (permalink / raw) To: Arnd Bergmann Cc: linux-kernel, Dmitry Torokhov, Maxime Coquelin, Alexandre Torgue, Krzysztof Kozlowski, Arnd Bergmann, Uwe Kleine-König, linux-input, linux-stm32, linux-arm-kernel On Wed, Apr 03, 2024 at 10:06:25AM +0200, Arnd Bergmann wrote: > From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > When compile tested with W=1 on x86_64 with driver as built-in: > > stmpe-ts.c:371:34: error: unused variable 'stmpe_ts_ids' [-Werror,-Wunused-const-variable] ... > -static const struct of_device_id stmpe_ts_ids[] = { > +static const struct of_device_id stmpe_ts_ids[] __maybe_unused = { __maybe_unused? Why not adding it into .driver as you have done in another patch in this series? > { .compatible = "st,stmpe-ts", }, > { }, > }; -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 07/34] Input: stmpe-ts - mark OF related data as maybe unused 2024-04-03 9:40 ` Andy Shevchenko @ 2024-04-03 9:52 ` Krzysztof Kozlowski 2024-04-03 10:03 ` Andy Shevchenko 0 siblings, 1 reply; 17+ messages in thread From: Krzysztof Kozlowski @ 2024-04-03 9:52 UTC (permalink / raw) To: Andy Shevchenko, Arnd Bergmann Cc: linux-kernel, Dmitry Torokhov, Maxime Coquelin, Alexandre Torgue, Arnd Bergmann, Uwe Kleine-König, linux-input, linux-stm32, linux-arm-kernel On 03/04/2024 11:40, Andy Shevchenko wrote: > On Wed, Apr 03, 2024 at 10:06:25AM +0200, Arnd Bergmann wrote: >> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >> >> When compile tested with W=1 on x86_64 with driver as built-in: >> >> stmpe-ts.c:371:34: error: unused variable 'stmpe_ts_ids' [-Werror,-Wunused-const-variable] > > ... > >> -static const struct of_device_id stmpe_ts_ids[] = { >> +static const struct of_device_id stmpe_ts_ids[] __maybe_unused = { > > __maybe_unused? > > Why not adding it into .driver as you have done in another patch in this series? Because there is no benefit in this. This is instantiated by MFD, so the only thing you need is entry for module loading. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 07/34] Input: stmpe-ts - mark OF related data as maybe unused 2024-04-03 9:52 ` Krzysztof Kozlowski @ 2024-04-03 10:03 ` Andy Shevchenko 2024-04-03 10:10 ` Krzysztof Kozlowski 0 siblings, 1 reply; 17+ messages in thread From: Andy Shevchenko @ 2024-04-03 10:03 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Arnd Bergmann, linux-kernel, Dmitry Torokhov, Maxime Coquelin, Alexandre Torgue, Arnd Bergmann, Uwe Kleine-König, linux-input, linux-stm32, linux-arm-kernel On Wed, Apr 03, 2024 at 11:52:12AM +0200, Krzysztof Kozlowski wrote: > On 03/04/2024 11:40, Andy Shevchenko wrote: > > On Wed, Apr 03, 2024 at 10:06:25AM +0200, Arnd Bergmann wrote: ... > >> -static const struct of_device_id stmpe_ts_ids[] = { > >> +static const struct of_device_id stmpe_ts_ids[] __maybe_unused = { > > > > __maybe_unused? > > > > Why not adding it into .driver as you have done in another patch in this series? > > Because there is no benefit in this. This is instantiated by MFD, so the > only thing you need is entry for module loading. Hmm... Seems to me rather a good candidate for MODULE_ALIAS in this case. No? -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 07/34] Input: stmpe-ts - mark OF related data as maybe unused 2024-04-03 10:03 ` Andy Shevchenko @ 2024-04-03 10:10 ` Krzysztof Kozlowski 0 siblings, 0 replies; 17+ messages in thread From: Krzysztof Kozlowski @ 2024-04-03 10:10 UTC (permalink / raw) To: Andy Shevchenko Cc: Arnd Bergmann, linux-kernel, Dmitry Torokhov, Maxime Coquelin, Alexandre Torgue, Arnd Bergmann, Uwe Kleine-König, linux-input, linux-stm32, linux-arm-kernel On 03/04/2024 12:03, Andy Shevchenko wrote: > On Wed, Apr 03, 2024 at 11:52:12AM +0200, Krzysztof Kozlowski wrote: >> On 03/04/2024 11:40, Andy Shevchenko wrote: >>> On Wed, Apr 03, 2024 at 10:06:25AM +0200, Arnd Bergmann wrote: > > ... > >>>> -static const struct of_device_id stmpe_ts_ids[] = { >>>> +static const struct of_device_id stmpe_ts_ids[] __maybe_unused = { >>> >>> __maybe_unused? >>> >>> Why not adding it into .driver as you have done in another patch in this series? >> >> Because there is no benefit in this. This is instantiated by MFD, so the >> only thing you need is entry for module loading. > > Hmm... Seems to me rather a good candidate for MODULE_ALIAS in this case. No? No, I do not think module alias is for that purpose. This is a valid compatible, documented and provided by DT so it is expected to be in of_device_id. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 07/34] Input: stmpe-ts - mark OF related data as maybe unused 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 13:17 ` Uwe Kleine-König 2024-04-03 13:27 ` Uwe Kleine-König 1 sibling, 1 reply; 17+ messages in thread From: Uwe Kleine-König @ 2024-04-03 13:17 UTC (permalink / raw) To: Arnd Bergmann Cc: linux-kernel, Dmitry Torokhov, Maxime Coquelin, Alexandre Torgue, Krzysztof Kozlowski, Arnd Bergmann, linux-input, linux-stm32, linux-arm-kernel [-- Attachment #1.1: Type: text/plain, Size: 2521 bytes --] Hello, On Wed, Apr 03, 2024 at 10:06:25AM +0200, Arnd Bergmann wrote: > From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > When compile tested with W=1 on x86_64 with driver as built-in: > > stmpe-ts.c:371:34: error: unused variable 'stmpe_ts_ids' [-Werror,-Wunused-const-variable] > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/input/touchscreen/stmpe-ts.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c > index b204fdb2d22c..022b3e94266d 100644 > --- a/drivers/input/touchscreen/stmpe-ts.c > +++ b/drivers/input/touchscreen/stmpe-ts.c > @@ -366,7 +366,7 @@ static struct platform_driver stmpe_ts_driver = { > }; > module_platform_driver(stmpe_ts_driver); > > -static const struct of_device_id stmpe_ts_ids[] = { > +static const struct of_device_id stmpe_ts_ids[] __maybe_unused = { > { .compatible = "st,stmpe-ts", }, > { }, > }; I'd suggest the following instead: diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c index b204fdb2d22c..e1afebc641ec 100644 --- a/drivers/input/touchscreen/stmpe-ts.c +++ b/drivers/input/touchscreen/stmpe-ts.c @@ -357,21 +357,22 @@ static void stmpe_ts_remove(struct platform_device *pdev) stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN); } -static struct platform_driver stmpe_ts_driver = { - .driver = { - .name = STMPE_TS_NAME, - }, - .probe = stmpe_input_probe, - .remove_new = stmpe_ts_remove, -}; -module_platform_driver(stmpe_ts_driver); - static const struct of_device_id stmpe_ts_ids[] = { { .compatible = "st,stmpe-ts", }, { }, }; MODULE_DEVICE_TABLE(of, stmpe_ts_ids); +static struct platform_driver stmpe_ts_driver = { + .driver = { + .name = STMPE_TS_NAME, + .of_match_table = stmpe_ts_ids, + }, + .probe = stmpe_input_probe, + .remove_new = stmpe_ts_remove, +}; +module_platform_driver(stmpe_ts_driver); + MODULE_AUTHOR("Luotao Fu <l.fu@pengutronix.de>"); MODULE_DESCRIPTION("STMPEXXX touchscreen driver"); MODULE_LICENSE("GPL"); I wonder if with the status quo binding via dt works at all with stmpe_ts_driver.driver.of_match_table unset?! Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ | [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] [-- Attachment #2: Type: text/plain, Size: 176 bytes --] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 07/34] Input: stmpe-ts - mark OF related data as maybe unused 2024-04-03 13:17 ` Uwe Kleine-König @ 2024-04-03 13:27 ` Uwe Kleine-König 0 siblings, 0 replies; 17+ messages in thread From: Uwe Kleine-König @ 2024-04-03 13:27 UTC (permalink / raw) To: Arnd Bergmann Cc: linux-kernel, Dmitry Torokhov, Maxime Coquelin, Alexandre Torgue, Krzysztof Kozlowski, Arnd Bergmann, linux-input, linux-stm32, linux-arm-kernel [-- Attachment #1.1: Type: text/plain, Size: 3145 bytes --] Hello again, On Wed, Apr 03, 2024 at 03:17:32PM +0200, Uwe Kleine-König wrote: > On Wed, Apr 03, 2024 at 10:06:25AM +0200, Arnd Bergmann wrote: > > From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > > > When compile tested with W=1 on x86_64 with driver as built-in: > > > > stmpe-ts.c:371:34: error: unused variable 'stmpe_ts_ids' [-Werror,-Wunused-const-variable] > > > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > --- > > drivers/input/touchscreen/stmpe-ts.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c > > index b204fdb2d22c..022b3e94266d 100644 > > --- a/drivers/input/touchscreen/stmpe-ts.c > > +++ b/drivers/input/touchscreen/stmpe-ts.c > > @@ -366,7 +366,7 @@ static struct platform_driver stmpe_ts_driver = { > > }; > > module_platform_driver(stmpe_ts_driver); > > > > -static const struct of_device_id stmpe_ts_ids[] = { > > +static const struct of_device_id stmpe_ts_ids[] __maybe_unused = { > > { .compatible = "st,stmpe-ts", }, > > { }, > > }; > > I'd suggest the following instead: > > diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c > index b204fdb2d22c..e1afebc641ec 100644 > --- a/drivers/input/touchscreen/stmpe-ts.c > +++ b/drivers/input/touchscreen/stmpe-ts.c > @@ -357,21 +357,22 @@ static void stmpe_ts_remove(struct platform_device *pdev) > stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN); > } > > -static struct platform_driver stmpe_ts_driver = { > - .driver = { > - .name = STMPE_TS_NAME, > - }, > - .probe = stmpe_input_probe, > - .remove_new = stmpe_ts_remove, > -}; > -module_platform_driver(stmpe_ts_driver); > - > static const struct of_device_id stmpe_ts_ids[] = { > { .compatible = "st,stmpe-ts", }, > { }, > }; > MODULE_DEVICE_TABLE(of, stmpe_ts_ids); > > +static struct platform_driver stmpe_ts_driver = { > + .driver = { > + .name = STMPE_TS_NAME, > + .of_match_table = stmpe_ts_ids, > + }, > + .probe = stmpe_input_probe, > + .remove_new = stmpe_ts_remove, > +}; > +module_platform_driver(stmpe_ts_driver); > + > MODULE_AUTHOR("Luotao Fu <l.fu@pengutronix.de>"); > MODULE_DESCRIPTION("STMPEXXX touchscreen driver"); > MODULE_LICENSE("GPL"); > > I wonder if with the status quo binding via dt works at all with > stmpe_ts_driver.driver.of_match_table unset?! I missed the discussion between Andy and Krzysztof when I wrote my mail. I still think this should be considered and if .of_match_table should stay unassigned (e.g. to allow dropping stmpe_ts_ids in case the driver is built-in?) I think adding a code comment would be appropriate because having an of_device_id array but not adding it to the driver is unusuall and generally a bad template for new drivers. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ | [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] [-- Attachment #2: Type: text/plain, Size: 176 bytes --] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 31/34] spi: remove incorrect of_match_ptr annotations [not found] <20240403080702.3509288-1-arnd@kernel.org> 2024-04-03 8:06 ` [PATCH 07/34] Input: stmpe-ts - mark OF related data as maybe unused Arnd Bergmann @ 2024-04-03 8:06 ` Arnd Bergmann 2024-04-03 9:04 ` Andy Shevchenko ` (2 more replies) 2024-04-03 8:06 ` [PATCH 32/34] ASoC: remove incorrect of_match_ptr/ACPI_PTR annotations Arnd Bergmann 2 siblings, 3 replies; 17+ messages in thread From: Arnd Bergmann @ 2024-04-03 8:06 UTC (permalink / raw) To: linux-kernel, Mark Brown, Neil Armstrong, Kevin Hilman, Heiko Stuebner, Andi Shyti, Krzysztof Kozlowski Cc: Arnd Bergmann, Jerome Brunet, Martin Blumenstingl, Alim Akhtar, Li Zetao, Jonathan Cameron, Rob Herring, Yang Yingliang, Andy Shevchenko, Luis de Arquer, Tudor Ambarus, Sam Protsenko, Peter Griffin, Jaewon Kim, linux-spi, linux-arm-kernel, linux-amlogic, linux-rockchip, linux-samsung-soc From: Arnd Bergmann <arnd@arndb.de> When building with CONFIG_OF disabled but W=1 extra warnings enabled, a couple of driver cause a warning about an unused ID table: drivers/spi/spi-armada-3700.c:806:34: error: unused variable 'a3700_spi_dt_ids' [-Werror,-Wunused-const-variable] drivers/spi/spi-orion.c:614:34: error: unused variable 'orion_spi_of_match_table' [-Werror,-Wunused-const-variable] drivers/spi/spi-pic32-sqi.c:673:34: error: unused variable 'pic32_sqi_of_ids' [-Werror,-Wunused-const-variable] drivers/spi/spi-pic32.c:850:34: error: unused variable 'pic32_spi_of_match' [-Werror,-Wunused-const-variable] drivers/spi/spi-rockchip.c:1020:34: error: unused variable 'rockchip_spi_dt_match' [-Werror,-Wunused-const-variable] drivers/spi/spi-s3c64xx.c:1642:34: error: unused variable 's3c64xx_spi_dt_match' [-Werror,-Wunused-const-variable] drivers/spi/spi-st-ssc4.c:439:34: error: unused variable 'stm_spi_match' [-Werror,-Wunused-const-variable] These appear to all be copied from the same original driver, so fix them at the same time by removing the unnecessary of_match_ptr() annotation. As far as I can tell, all these drivers are only actually used on configurations that have CONFIG_OF enabled. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- 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 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/spi/spi-armada-3700.c b/drivers/spi/spi-armada-3700.c index 3c9ed412932f..2fc2e7c0daf2 100644 --- a/drivers/spi/spi-armada-3700.c +++ b/drivers/spi/spi-armada-3700.c @@ -902,7 +902,7 @@ static int a3700_spi_probe(struct platform_device *pdev) static struct platform_driver a3700_spi_driver = { .driver = { .name = DRIVER_NAME, - .of_match_table = of_match_ptr(a3700_spi_dt_ids), + .of_match_table = a3700_spi_dt_ids, }, .probe = a3700_spi_probe, }; diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c index d8360f94d3b7..0d7f89301f8d 100644 --- a/drivers/spi/spi-img-spfi.c +++ b/drivers/spi/spi-img-spfi.c @@ -753,7 +753,7 @@ static struct platform_driver img_spfi_driver = { .driver = { .name = "img-spfi", .pm = &img_spfi_pm_ops, - .of_match_table = of_match_ptr(img_spfi_of_match), + .of_match_table = img_spfi_of_match, }, .probe = img_spfi_probe, .remove_new = img_spfi_remove, diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c index fc75492e50ff..4189d4434e37 100644 --- a/drivers/spi/spi-meson-spicc.c +++ b/drivers/spi/spi-meson-spicc.c @@ -946,7 +946,7 @@ static struct platform_driver meson_spicc_driver = { .remove_new = meson_spicc_remove, .driver = { .name = "meson-spicc", - .of_match_table = of_match_ptr(meson_spicc_of_match), + .of_match_table = meson_spicc_of_match, }, }; diff --git a/drivers/spi/spi-meson-spifc.c b/drivers/spi/spi-meson-spifc.c index fd8b26dd4a79..0c39d59d0af8 100644 --- a/drivers/spi/spi-meson-spifc.c +++ b/drivers/spi/spi-meson-spifc.c @@ -432,7 +432,7 @@ static struct platform_driver meson_spifc_driver = { .remove_new = meson_spifc_remove, .driver = { .name = "meson-spifc", - .of_match_table = of_match_ptr(meson_spifc_dt_match), + .of_match_table = meson_spifc_dt_match, .pm = &meson_spifc_pm_ops, }, }; diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c index eee9ff4bfa5b..a0029e8dc0be 100644 --- a/drivers/spi/spi-orion.c +++ b/drivers/spi/spi-orion.c @@ -843,7 +843,7 @@ static struct platform_driver orion_spi_driver = { .driver = { .name = DRIVER_NAME, .pm = &orion_spi_pm_ops, - .of_match_table = of_match_ptr(orion_spi_of_match_table), + .of_match_table = orion_spi_of_match_table, }, .probe = orion_spi_probe, .remove_new = orion_spi_remove, diff --git a/drivers/spi/spi-pic32-sqi.c b/drivers/spi/spi-pic32-sqi.c index 3f1e5b27776b..458c1a8d5719 100644 --- a/drivers/spi/spi-pic32-sqi.c +++ b/drivers/spi/spi-pic32-sqi.c @@ -679,7 +679,7 @@ MODULE_DEVICE_TABLE(of, pic32_sqi_of_ids); static struct platform_driver pic32_sqi_driver = { .driver = { .name = "sqi-pic32", - .of_match_table = of_match_ptr(pic32_sqi_of_ids), + .of_match_table = pic32_sqi_of_ids, }, .probe = pic32_sqi_probe, .remove_new = pic32_sqi_remove, diff --git a/drivers/spi/spi-pic32.c b/drivers/spi/spi-pic32.c index 709edb70ad7d..e8bd32c1fc7c 100644 --- a/drivers/spi/spi-pic32.c +++ b/drivers/spi/spi-pic32.c @@ -856,7 +856,7 @@ MODULE_DEVICE_TABLE(of, pic32_spi_of_match); static struct platform_driver pic32_spi_driver = { .driver = { .name = "spi-pic32", - .of_match_table = of_match_ptr(pic32_spi_of_match), + .of_match_table = pic32_spi_of_match, }, .probe = pic32_spi_probe, .remove_new = pic32_spi_remove, diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index e1ecd96c7858..4dbb5127a9e5 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -1042,7 +1042,7 @@ static struct platform_driver rockchip_spi_driver = { .driver = { .name = DRIVER_NAME, .pm = &rockchip_spi_pm, - .of_match_table = of_match_ptr(rockchip_spi_dt_match), + .of_match_table = rockchip_spi_dt_match, }, .probe = rockchip_spi_probe, .remove_new = rockchip_spi_remove, diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index f726d8670428..dbb89f6cb3dd 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1677,7 +1677,7 @@ static struct platform_driver s3c64xx_spi_driver = { .driver = { .name = "s3c64xx-spi", .pm = &s3c64xx_spi_pm, - .of_match_table = of_match_ptr(s3c64xx_spi_dt_match), + .of_match_table = s3c64xx_spi_dt_match, }, .probe = s3c64xx_spi_probe, .remove_new = s3c64xx_spi_remove, diff --git a/drivers/spi/spi-st-ssc4.c b/drivers/spi/spi-st-ssc4.c index e064025e2fd6..6d288497c500 100644 --- a/drivers/spi/spi-st-ssc4.c +++ b/drivers/spi/spi-st-ssc4.c @@ -446,7 +446,7 @@ static struct platform_driver spi_st_driver = { .driver = { .name = "spi-st", .pm = &spi_st_pm, - .of_match_table = of_match_ptr(stm_spi_match), + .of_match_table = stm_spi_match, }, .probe = spi_st_probe, .remove_new = spi_st_remove, -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 31/34] spi: remove incorrect of_match_ptr annotations 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 2 siblings, 0 replies; 17+ messages in thread From: Andy Shevchenko @ 2024-04-03 9:04 UTC (permalink / raw) To: Arnd Bergmann Cc: linux-kernel, Mark Brown, Neil Armstrong, Kevin Hilman, Heiko Stuebner, Andi Shyti, Krzysztof Kozlowski, Arnd Bergmann, Jerome Brunet, Martin Blumenstingl, Alim Akhtar, Li Zetao, Jonathan Cameron, Rob Herring, Yang Yingliang, Luis de Arquer, Tudor Ambarus, Sam Protsenko, Peter Griffin, Jaewon Kim, linux-spi, linux-arm-kernel, linux-amlogic, linux-rockchip, linux-samsung-soc On Wed, Apr 03, 2024 at 10:06:49AM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > When building with CONFIG_OF disabled but W=1 extra warnings enabled, > a couple of driver cause a warning about an unused ID table: > > drivers/spi/spi-armada-3700.c:806:34: error: unused variable 'a3700_spi_dt_ids' [-Werror,-Wunused-const-variable] > drivers/spi/spi-orion.c:614:34: error: unused variable 'orion_spi_of_match_table' [-Werror,-Wunused-const-variable] > drivers/spi/spi-pic32-sqi.c:673:34: error: unused variable 'pic32_sqi_of_ids' [-Werror,-Wunused-const-variable] > drivers/spi/spi-pic32.c:850:34: error: unused variable 'pic32_spi_of_match' [-Werror,-Wunused-const-variable] > drivers/spi/spi-rockchip.c:1020:34: error: unused variable 'rockchip_spi_dt_match' [-Werror,-Wunused-const-variable] > drivers/spi/spi-s3c64xx.c:1642:34: error: unused variable 's3c64xx_spi_dt_match' [-Werror,-Wunused-const-variable] > drivers/spi/spi-st-ssc4.c:439:34: error: unused variable 'stm_spi_match' [-Werror,-Wunused-const-variable] I would drop these 'drivers/spi/' parts as we know they are all in the same folder. > These appear to all be copied from the same original driver, so fix them at the > same time by removing the unnecessary of_match_ptr() annotation. As far as I > can tell, all these drivers are only actually used on configurations that > have CONFIG_OF enabled. LGTM, Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 31/34] spi: remove incorrect of_match_ptr annotations 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 2 siblings, 0 replies; 17+ messages in thread From: Krzysztof Kozlowski @ 2024-04-03 9:05 UTC (permalink / raw) To: Arnd Bergmann, linux-kernel, Mark Brown, Neil Armstrong, Kevin Hilman, Heiko Stuebner, Andi Shyti Cc: Arnd Bergmann, Jerome Brunet, Martin Blumenstingl, Alim Akhtar, Li Zetao, Jonathan Cameron, Rob Herring, Yang Yingliang, Andy Shevchenko, Luis de Arquer, Tudor Ambarus, Sam Protsenko, Peter Griffin, Jaewon Kim, linux-spi, linux-arm-kernel, linux-amlogic, linux-rockchip, linux-samsung-soc On 03/04/2024 10:06, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > When building with CONFIG_OF disabled but W=1 extra warnings enabled, > a couple of driver cause a warning about an unused ID table: > > drivers/spi/spi-armada-3700.c:806:34: error: unused variable 'a3700_spi_dt_ids' [-Werror,-Wunused-const-variable] > drivers/spi/spi-orion.c:614:34: error: unused variable 'orion_spi_of_match_table' [-Werror,-Wunused-const-variable] > drivers/spi/spi-pic32-sqi.c:673:34: error: unused variable 'pic32_sqi_of_ids' [-Werror,-Wunused-const-variable] > drivers/spi/spi-pic32.c:850:34: error: unused variable 'pic32_spi_of_match' [-Werror,-Wunused-const-variable] > drivers/spi/spi-rockchip.c:1020:34: error: unused variable 'rockchip_spi_dt_match' [-Werror,-Wunused-const-variable] > drivers/spi/spi-s3c64xx.c:1642:34: error: unused variable 's3c64xx_spi_dt_match' [-Werror,-Wunused-const-variable] > drivers/spi/spi-st-ssc4.c:439:34: error: unused variable 'stm_spi_match' [-Werror,-Wunused-const-variable] > > These appear to all be copied from the same original driver, so fix them at the > same time by removing the unnecessary of_match_ptr() annotation. As far as I > can tell, all these drivers are only actually used on configurations that > have CONFIG_OF enabled. I think I already tried to fix all of these, but Mark rejected my patches: https://lore.kernel.org/all/7a65d775-cf07-4393-8b10-2cef4d5266ab@sirena.org.uk/ All of the changes here look the same as my patchset, I also got there some Acks. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 31/34] spi: remove incorrect of_match_ptr annotations 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 2 siblings, 1 reply; 17+ messages in thread From: Mark Brown @ 2024-04-03 9:56 UTC (permalink / raw) To: Arnd Bergmann Cc: linux-kernel, Neil Armstrong, Kevin Hilman, Heiko Stuebner, Andi Shyti, Krzysztof Kozlowski, Arnd Bergmann, Jerome Brunet, Martin Blumenstingl, Alim Akhtar, Li Zetao, Jonathan Cameron, Rob Herring, Yang Yingliang, Andy Shevchenko, Luis de Arquer, Tudor Ambarus, Sam Protsenko, Peter Griffin, Jaewon Kim, linux-spi, linux-arm-kernel, linux-amlogic, linux-rockchip, linux-samsung-soc [-- Attachment #1.1: Type: text/plain, Size: 778 bytes --] On Wed, Apr 03, 2024 at 10:06:49AM +0200, Arnd Bergmann wrote: > These appear to all be copied from the same original driver, so fix them at the > same time by removing the unnecessary of_match_ptr() annotation. As far as I > can tell, all these drivers are only actually used on configurations that > have CONFIG_OF enabled. Why are we not fixing of_match_ptr() here, or at least adding the ifdefs in case someone does end up wanting to run without OF? Just as a general thing for something like this where the patches aren't expected to get merged together it makes life much easier to not send as a series - pulling individual patches out of a series causes issues with things like b4, especially if you have to apply them to multiple places, and there's limited benefit. [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] [-- Attachment #2: Type: text/plain, Size: 176 bytes --] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 31/34] spi: remove incorrect of_match_ptr annotations 2024-04-03 9:56 ` Mark Brown @ 2024-04-03 21:05 ` Uwe Kleine-König 2024-04-03 21:13 ` Andy Shevchenko 0 siblings, 1 reply; 17+ messages in thread From: Uwe Kleine-König @ 2024-04-03 21:05 UTC (permalink / raw) To: Mark Brown Cc: Arnd Bergmann, linux-kernel, Neil Armstrong, Kevin Hilman, Heiko Stuebner, Andi Shyti, Krzysztof Kozlowski, Arnd Bergmann, Jerome Brunet, Martin Blumenstingl, Alim Akhtar, Li Zetao, Jonathan Cameron, Rob Herring, Yang Yingliang, Andy Shevchenko, Luis de Arquer, Tudor Ambarus, Sam Protsenko, Peter Griffin, Jaewon Kim, linux-spi, linux-arm-kernel, linux-amlogic, linux-rockchip, linux-samsung-soc [-- Attachment #1.1: Type: text/plain, Size: 1241 bytes --] On Wed, Apr 03, 2024 at 10:56:58AM +0100, Mark Brown wrote: > On Wed, Apr 03, 2024 at 10:06:49AM +0200, Arnd Bergmann wrote: > > > These appear to all be copied from the same original driver, so fix them at the > > same time by removing the unnecessary of_match_ptr() annotation. As far as I > > can tell, all these drivers are only actually used on configurations that > > have CONFIG_OF enabled. > > Why are we not fixing of_match_ptr() here, or at least adding the ifdefs > in case someone does end up wanting to run without OF? Fixing of_match_ptr = diff --git a/include/linux/of.h b/include/linux/of.h index a0bedd038a05..d980bccffda0 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -890,7 +890,7 @@ static inline const void *of_device_get_match_data(const struct device *dev) return NULL; } -#define of_match_ptr(_ptr) NULL +#define of_match_ptr(_ptr) (0 ? (_ptr) : NULL) #define of_match_node(_matches, _node) NULL #endif /* CONFIG_OF */ ? Assuming this helps, I agree this would be the better fix. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ | [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] [-- Attachment #2: Type: text/plain, Size: 176 bytes --] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 31/34] spi: remove incorrect of_match_ptr annotations 2024-04-03 21:05 ` Uwe Kleine-König @ 2024-04-03 21:13 ` Andy Shevchenko 2024-04-03 22:19 ` Arnd Bergmann 0 siblings, 1 reply; 17+ messages in thread From: Andy Shevchenko @ 2024-04-03 21:13 UTC (permalink / raw) To: Uwe Kleine-König Cc: Mark Brown, Arnd Bergmann, linux-kernel, Neil Armstrong, Kevin Hilman, Heiko Stuebner, Andi Shyti, Krzysztof Kozlowski, Arnd Bergmann, Jerome Brunet, Martin Blumenstingl, Alim Akhtar, Li Zetao, Jonathan Cameron, Rob Herring, Yang Yingliang, Andy Shevchenko, Luis de Arquer, Tudor Ambarus, Sam Protsenko, Peter Griffin, Jaewon Kim, linux-spi, linux-arm-kernel, linux-amlogic, linux-rockchip, linux-samsung-soc Wed, Apr 03, 2024 at 11:05:51PM +0200, Uwe Kleine-König kirjoitti: > On Wed, Apr 03, 2024 at 10:56:58AM +0100, Mark Brown wrote: > > On Wed, Apr 03, 2024 at 10:06:49AM +0200, Arnd Bergmann wrote: > > > > > These appear to all be copied from the same original driver, so fix them at the > > > same time by removing the unnecessary of_match_ptr() annotation. As far as I > > > can tell, all these drivers are only actually used on configurations that > > > have CONFIG_OF enabled. > > > > Why are we not fixing of_match_ptr() here, or at least adding the ifdefs > > in case someone does end up wanting to run without OF? > > Fixing of_match_ptr = > > diff --git a/include/linux/of.h b/include/linux/of.h > index a0bedd038a05..d980bccffda0 100644 > --- a/include/linux/of.h > +++ b/include/linux/of.h > @@ -890,7 +890,7 @@ static inline const void *of_device_get_match_data(const struct device *dev) > return NULL; > } > > -#define of_match_ptr(_ptr) NULL > +#define of_match_ptr(_ptr) (0 ? (_ptr) : NULL) FWIW, we have PTR_IF() (with a side note to split it from kernel.h in a separate header or less twisted one). > #define of_match_node(_matches, _node) NULL > #endif /* CONFIG_OF */ > > ? > > Assuming this helps, I agree this would be the better fix. Why? I mean why do we need to even have this API? It's always good to know which devices are supported by the module even if you have no need in such support or it's not compiled in. One of the reasons why is to be able to google for compatible hardware, for example. -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 31/34] spi: remove incorrect of_match_ptr annotations 2024-04-03 21:13 ` Andy Shevchenko @ 2024-04-03 22:19 ` Arnd Bergmann 0 siblings, 0 replies; 17+ messages in thread From: Arnd Bergmann @ 2024-04-03 22:19 UTC (permalink / raw) To: Andy Shevchenko, Uwe Kleine-König Cc: Mark Brown, Arnd Bergmann, linux-kernel, Neil Armstrong, Kevin Hilman, Heiko Stübner, Andi Shyti, Krzysztof Kozlowski, Jerome Brunet, Martin Blumenstingl, Alim Akhtar, Li Zetao, Jonathan Cameron, Rob Herring, Yang Yingliang, Andy Shevchenko, Luis de Arquer, Tudor Ambarus, Sam Protsenko, Peter Griffin, Jaewon Kim, linux-spi, linux-arm-kernel, linux-amlogic, linux-rockchip, linux-samsung-soc On Wed, Apr 3, 2024, at 23:13, Andy Shevchenko wrote: > Wed, Apr 03, 2024 at 11:05:51PM +0200, Uwe Kleine-König kirjoitti: >> On Wed, Apr 03, 2024 at 10:56:58AM +0100, Mark Brown wrote: >> > On Wed, Apr 03, 2024 at 10:06:49AM +0200, Arnd Bergmann wrote: >> > >> > > These appear to all be copied from the same original driver, so fix them at the >> > > same time by removing the unnecessary of_match_ptr() annotation. As far as I >> > > can tell, all these drivers are only actually used on configurations that >> > > have CONFIG_OF enabled. >> > >> > Why are we not fixing of_match_ptr() here, or at least adding the ifdefs >> > in case someone does end up wanting to run without OF? >> >> Fixing of_match_ptr = >> >> diff --git a/include/linux/of.h b/include/linux/of.h >> index a0bedd038a05..d980bccffda0 100644 >> --- a/include/linux/of.h >> +++ b/include/linux/of.h >> @@ -890,7 +890,7 @@ static inline const void *of_device_get_match_data(const struct device *dev) >> return NULL; >> } >> >> -#define of_match_ptr(_ptr) NULL >> +#define of_match_ptr(_ptr) (0 ? (_ptr) : NULL) This would require removing several hundred "#ifdef CONFIG_OF" checks around the of_device_id tables at the same time unfortunately. Most of those are completely unnecessary, so if we wanted to remove those, we should remove the of_match_ptr() instances at the same time. >> #define of_match_node(_matches, _node) NULL >> #endif /* CONFIG_OF */ >> >> ? >> >> Assuming this helps, I agree this would be the better fix. > > Why? I mean why do we need to even have this API? It's always > good to know which devices are supported by the module even > if you have no need in such support or it's not compiled in. > One of the reasons why is to be able to google for compatible hardware, > for example. As far as I can tell, the of_match_ptr() helper was a historic mistake, it makes pretty much no sense in its current form. The version that Uwe proposes would have made sense but we can't change it now. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 32/34] ASoC: remove incorrect of_match_ptr/ACPI_PTR annotations [not found] <20240403080702.3509288-1-arnd@kernel.org> 2024-04-03 8:06 ` [PATCH 07/34] Input: stmpe-ts - mark OF related data as maybe unused Arnd Bergmann 2024-04-03 8:06 ` [PATCH 31/34] spi: remove incorrect of_match_ptr annotations Arnd Bergmann @ 2024-04-03 8:06 ` Arnd Bergmann 2024-04-03 9:06 ` Krzysztof Kozlowski 2024-04-03 9:15 ` Andy Shevchenko 2 siblings, 2 replies; 17+ messages in thread From: Arnd Bergmann @ 2024-04-03 8:06 UTC (permalink / raw) To: linux-kernel, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai, Claudiu Beznea, Nicolas Ferre, Alexandre Belloni, Oder Chiou, Srinivas Kandagatla, Banajit Goswami, Sylwester Nawrocki Cc: Arnd Bergmann, Alper Nebi Yasak, Kuninori Morimoto, Akihiko Odaki, Linus Walleij, Yinchuan Guo, Uwe Kleine-König, Rob Herring, AngeloGioacchino Del Regno, Krzysztof Kozlowski, linux-sound, alsa-devel, linux-arm-kernel 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: sound/soc/atmel/sam9x5_wm8731.c:187:34: error: unused variable 'sam9x5_wm8731_of_match' [-Werror,-Wunused-const-variable] sound/soc/codecs/rt5514-spi.c:496:34: error: unused variable 'rt5514_of_match' [-Werror,-Wunused-const-variable] sound/soc/samsung/aries_wm8994.c:524:34: error: unused variable 'samsung_wm8994_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. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- sound/soc/amd/acp3x-rt5682-max9836.c | 2 +- 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 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c index d6cdb6d9fdd6..ffc105759994 100644 --- a/sound/soc/amd/acp3x-rt5682-max9836.c +++ b/sound/soc/amd/acp3x-rt5682-max9836.c @@ -543,7 +543,7 @@ MODULE_DEVICE_TABLE(acpi, acp3x_audio_acpi_match); static struct platform_driver acp3x_audio = { .driver = { .name = "acp3x-alc5682-max98357", - .acpi_match_table = ACPI_PTR(acp3x_audio_acpi_match), + .acpi_match_table = acp3x_audio_acpi_match, .pm = &snd_soc_pm_ops, }, .probe = acp3x_probe, diff --git a/sound/soc/atmel/sam9x5_wm8731.c b/sound/soc/atmel/sam9x5_wm8731.c index d1c1f370a9cd..95c8c37478a3 100644 --- a/sound/soc/atmel/sam9x5_wm8731.c +++ b/sound/soc/atmel/sam9x5_wm8731.c @@ -193,7 +193,7 @@ MODULE_DEVICE_TABLE(of, sam9x5_wm8731_of_match); static struct platform_driver sam9x5_wm8731_driver = { .driver = { .name = DRV_NAME, - .of_match_table = of_match_ptr(sam9x5_wm8731_of_match), + .of_match_table = sam9x5_wm8731_of_match, }, .probe = sam9x5_wm8731_driver_probe, .remove_new = sam9x5_wm8731_driver_remove, diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c index f475c8cfadae..da397db8d7d5 100644 --- a/sound/soc/codecs/rt5514-spi.c +++ b/sound/soc/codecs/rt5514-spi.c @@ -503,7 +503,7 @@ static struct spi_driver rt5514_spi_driver = { .driver = { .name = "rt5514", .pm = &rt5514_pm_ops, - .of_match_table = of_match_ptr(rt5514_of_match), + .of_match_table = rt5514_of_match, }, .probe = rt5514_spi_probe, }; diff --git a/sound/soc/qcom/lpass-sc7280.c b/sound/soc/qcom/lpass-sc7280.c index 47c622327a8d..c91620128fd4 100644 --- a/sound/soc/qcom/lpass-sc7280.c +++ b/sound/soc/qcom/lpass-sc7280.c @@ -441,7 +441,7 @@ MODULE_DEVICE_TABLE(of, sc7280_lpass_cpu_device_id); static struct platform_driver sc7280_lpass_cpu_platform_driver = { .driver = { .name = "sc7280-lpass-cpu", - .of_match_table = of_match_ptr(sc7280_lpass_cpu_device_id), + .of_match_table = sc7280_lpass_cpu_device_id, .pm = &sc7280_lpass_pm_ops, }, .probe = asoc_qcom_lpass_cpu_platform_probe, diff --git a/sound/soc/samsung/aries_wm8994.c b/sound/soc/samsung/aries_wm8994.c index a548ac33dd94..9f7318c4ee33 100644 --- a/sound/soc/samsung/aries_wm8994.c +++ b/sound/soc/samsung/aries_wm8994.c @@ -689,7 +689,7 @@ static int aries_audio_probe(struct platform_device *pdev) static struct platform_driver aries_audio_driver = { .driver = { .name = "aries-audio-wm8994", - .of_match_table = of_match_ptr(samsung_wm8994_of_match), + .of_match_table = samsung_wm8994_of_match, .pm = &snd_soc_pm_ops, }, .probe = aries_audio_probe, -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 32/34] ASoC: remove incorrect of_match_ptr/ACPI_PTR annotations 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 1 sibling, 0 replies; 17+ messages in thread From: Krzysztof Kozlowski @ 2024-04-03 9:06 UTC (permalink / raw) To: Arnd Bergmann, linux-kernel, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai, Claudiu Beznea, Nicolas Ferre, Alexandre Belloni, Oder Chiou, Srinivas Kandagatla, Banajit Goswami, Sylwester Nawrocki Cc: Arnd Bergmann, Alper Nebi Yasak, Kuninori Morimoto, Akihiko Odaki, Linus Walleij, Yinchuan Guo, Uwe Kleine-König, Rob Herring, AngeloGioacchino Del Regno, linux-sound, alsa-devel, linux-arm-kernel On 03/04/2024 10:06, 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: > > sound/soc/atmel/sam9x5_wm8731.c:187:34: error: unused variable 'sam9x5_wm8731_of_match' [-Werror,-Wunused-const-variable] > sound/soc/codecs/rt5514-spi.c:496:34: error: unused variable 'rt5514_of_match' [-Werror,-Wunused-const-variable] > sound/soc/samsung/aries_wm8994.c:524:34: error: unused variable 'samsung_wm8994_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. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > sound/soc/amd/acp3x-rt5682-max9836.c | 2 +- > 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 +- I sent it already as well: https://lore.kernel.org/all/20230310214333.274903-5-krzysztof.kozlowski@linaro.org/ and Mark did not pick it up, I guess for the same reason as SPI. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 32/34] ASoC: remove incorrect of_match_ptr/ACPI_PTR annotations 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 1 sibling, 0 replies; 17+ messages in thread From: Andy Shevchenko @ 2024-04-03 9:15 UTC (permalink / raw) To: Arnd Bergmann Cc: Alexandre Belloni, Akihiko Odaki, Kuninori Morimoto, Linus Walleij, alsa-devel, linux-kernel, Srinivas Kandagatla, Sylwester Nawrocki, Claudiu Beznea, Rob Herring, Yinchuan Guo, Takashi Iwai, Uwe Kleine-König, Arnd Bergmann, linux-sound, Alper Nebi Yasak, Mark Brown, Jaroslav Kysela, linux-arm-kernel, AngeloGioacchino Del Regno, Oder Chiou, Liam Girdwood, Krzysztof Kozlowski, Banajit Goswami On Wed, Apr 03, 2024 at 10:06:50AM +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: > > sound/soc/atmel/sam9x5_wm8731.c:187:34: error: unused variable 'sam9x5_wm8731_of_match' [-Werror,-Wunused-const-variable] > sound/soc/codecs/rt5514-spi.c:496:34: error: unused variable 'rt5514_of_match' [-Werror,-Wunused-const-variable] > sound/soc/samsung/aries_wm8994.c:524:34: error: unused variable 'samsung_wm8994_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. ... > index d6cdb6d9fdd6..ffc105759994 100644 > --- a/sound/soc/amd/acp3x-rt5682-max9836.c > +++ b/sound/soc/amd/acp3x-rt5682-max9836.c > @@ -543,7 +543,7 @@ MODULE_DEVICE_TABLE(acpi, acp3x_audio_acpi_match); > static struct platform_driver acp3x_audio = { > .driver = { > .name = "acp3x-alc5682-max98357", > - .acpi_match_table = ACPI_PTR(acp3x_audio_acpi_match), > + .acpi_match_table = acp3x_audio_acpi_match, > .pm = &snd_soc_pm_ops, > }, > .probe = acp3x_probe, Replace acpi_match_device() by device_get_match_data() and acpi.h by mod_devicetable.h + property.h. I really would like to see agnostic drivers (when they don't need of*.h/acpi.h to be included as "proxy" headers). With this, the change probably needs to be separated from this patch. If you address as suggested, Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> ... The rest I haven't checked, it might be possible to do something similar there as well. -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2024-04-03 22:20 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240403080702.3509288-1-arnd@kernel.org>
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 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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).