spi: armada-3700: Drop of_match_ptr for ID table
Subsystems (10)
PATCH 1/16 spi: armada-3700: Drop of_match_ptr for ID table
The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-armada-3700.c:807:34: error: ‘a3700_spi_dt_ids’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-armada-3700.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-armada-3700.c +1 -1
@@ -919,7 +919,7 @@ static void a3700_spi_remove(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, .remove_new = a3700_spi_remove,
Signature · 1 line
2.34.1
PATCH 2/16 spi: mtk-pmif: Drop of_match_ptr for ID table
The driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spmi/spmi-mtk-pmif.c:517:34: error: ‘mtk_spmi_match_table’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spmi/spmi-mtk-pmif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spmi/spmi-mtk-pmif.c +1 -1
@@ -530,7 +530,7 @@ MODULE_DEVICE_TABLE(of, mtk_spmi_match_table);static struct platform_driver mtk_spmi_driver = { .driver = { .name ="spmi-mtk" , - .of_match_table =of_match_ptr (mtk_spmi_match_table), + .of_match_table = mtk_spmi_match_table, }, .probe = mtk_spmi_probe, .remove = mtk_spmi_remove,
Signature · 1 line
2.34.1
Re: [PATCH 02/16] spi: mtk-pmif: Drop of_match_ptr for ID table
Il 10/03/23 23:28, Krzysztof Kozlowski ha scritto:
Quoted 7 lines
The driver can match only via the DT table so the table should be always used and the
of_match_ptrdoes not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spmi/spmi-mtk-pmif.c:517:34: error: ‘mtk_spmi_match_table’ defined but not used [-Werror=unused-const-variable=]Signed-off-by Krzysztof Kozlowski <[email protected]>
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Re: [PATCH 02/16] spi: mtk-pmif: Drop of_match_ptr for ID table
In reply to Krzysztof KozlowskiThe subject says 'spi' but it's actually 'spmi'.
Quoting Krzysztof Kozlowski (2023-03-10 14:28:43)
Quoted 8 lines
The driver can match only via the DT table so the table should be always used and the
of_match_ptrdoes not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spmi/spmi-mtk-pmif.c:517:34: error: ‘mtk_spmi_match_table’ defined but not used [-Werror=unused-const-variable=]Signed-off-by Krzysztof Kozlowski <[email protected]>---
Re: [PATCH 02/16] spi: mtk-pmif: Drop of_match_ptr for ID table
In reply to Krzysztof KozlowskiQuoting Krzysztof Kozlowski (2023-03-10 14:28:43)
Quoted 8 lines
The driver can match only via the DT table so the table should be always used and the
of_match_ptrdoes not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spmi/spmi-mtk-pmif.c:517:34: error: ‘mtk_spmi_match_table’ defined but not used [-Werror=unused-const-variable=]Signed-off-by Krzysztof Kozlowski <[email protected]>---
I'll fix the subject.
Applied to spmi-next
Re: [PATCH 02/16] spi: mtk-pmif: Drop of_match_ptr for ID table
Quoted 5 lines · Stephen Boyd
Quoting Krzysztof Kozlowski (2023-03-10 14:28:43)
Quoted 4 lines
The driver can match only via the DT table so the table should be always used and the
of_match_ptrdoes not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
Quoted 8 lines
Quoted 4 lines
drivers/spmi/spmi-mtk-pmif.c:517:34: error: ‘mtk_spmi_match_table’ defined but not used [-Werror=unused-const-variable=]Signed-off-by Krzysztof Kozlowski <[email protected]>---
I'll fix the subject.
Applied to spmi-next
Thanks. Apologies for the typo in the subject.
Best regards,
Krzysztof
PATCH 3/16 spi: meson-spicc: Drop of_match_ptr for ID table
In reply to Krzysztof KozlowskiThe driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-meson-spicc.c:949:34: error: ‘meson_spicc_of_match’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-meson-spicc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-meson-spicc.c +1 -1
@@ -968,7 +968,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, }, };
Signature · 1 line
2.34.1
Re: [PATCH 03/16] spi: meson-spicc: Drop of_match_ptr for ID table
Quoted 8 lines · Krzysztof Kozlowski
The driver can match only via the DT table so the table should be always used and the
of_match_ptrdoes not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-meson-spicc.c:949:34: error: ‘meson_spicc_of_match’ defined but not used [-Werror=unused-const-variable=]Signed-off-by Krzysztof Kozlowski <[email protected]>
PATCH 4/16 spi: meson-spifc: Drop of_match_ptr for ID table
In reply to Krzysztof KozlowskiThe driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-meson-spifc.c:434:34: error: ‘meson_spifc_dt_match’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-meson-spifc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-meson-spifc.c +1 -1
@@ -443,7 +443,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, }, };
Signature · 1 line
2.34.1
Re: [PATCH 04/16] spi: meson-spifc: Drop of_match_ptr for ID table
Quoted 8 lines · Krzysztof Kozlowski
The driver can match only via the DT table so the table should be always used and the
of_match_ptrdoes not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-meson-spifc.c:434:34: error: ‘meson_spifc_dt_match’ defined but not used [-Werror=unused-const-variable=]Signed-off-by Krzysztof Kozlowski <[email protected]>
PATCH 5/16 spi: orion: Drop of_match_ptr for ID table
In reply to Krzysztof KozlowskiThe driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-orion.c:615:34: error: ‘orion_spi_of_match_table’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-orion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-orion.c +1 -1
@@ -852,7 +852,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,
Signature · 1 line
2.34.1
PATCH 6/16 spi: rockchip: Drop of_match_ptr for ID table
In reply to Krzysztof KozlowskiThe driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-rockchip.c:1051:34: error: ‘rockchip_spi_dt_match’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-rockchip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-rockchip.c +1 -1
@@ -1069,7 +1069,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,
Signature · 1 line
2.34.1
Re: [PATCH 06/16] spi: rockchip: Drop of_match_ptr for ID table
Am Freitag, 10. März 2023, 23:28:47 CET schrieb Krzysztof Kozlowski:
Quoted 7 lines
The driver can match only via the DT table so the table should be always used and the
of_match_ptrdoes not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-rockchip.c:1051:34: error: ‘rockchip_spi_dt_match’ defined but not used [-Werror=unused-const-variable=]Signed-off-by Krzysztof Kozlowski <[email protected]>
PATCH 7/16 spi: s3c64xx: Drop of_match_ptr for ID table
In reply to Krzysztof KozlowskiThe driver can match only via the DT table (all platforms are OF-only) so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-s3c64xx.c:1496:34: error: ‘s3c64xx_spi_dt_match’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-s3c64xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-s3c64xx.c +1 -1
@@ -1526,7 +1526,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,
Signature · 1 line
2.34.1
Re: [PATCH 07/16] spi: s3c64xx: Drop of_match_ptr for ID table
Hi Krzysztof,
Quoted 8 lines · Krzysztof Kozlowski
The driver can match only via the DT table (all platforms are OF-only) so the table should be always used and the
of_match_ptrdoes not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-s3c64xx.c:1496:34: error: ‘s3c64xx_spi_dt_match’ defined but not used [-Werror=unused-const-variable=]Signed-off-by Krzysztof Kozlowski <[email protected]>
Thanks,
Andi
PATCH 8/16 spi: img-spfi: Drop of_match_ptr for ID table
In reply to Krzysztof KozlowskiThe driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-img-spfi.c:746:34: error: ‘img_spfi_of_match’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-img-spfi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-img-spfi.c +1 -1
@@ -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,
Signature · 1 line
2.34.1
PATCH 9/16 spi: pic32-sqi: Drop of_match_ptr for ID table
In reply to Krzysztof KozlowskiThe driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-pic32-sqi.c:694:34: error: ‘pic32_sqi_of_ids’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-pic32-sqi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-pic32-sqi.c +1 -1
@@ -700,7 +700,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,
Signature · 1 line
2.34.1
PATCH 10/16 spi: pic32: Drop of_match_ptr for ID table
In reply to Krzysztof KozlowskiThe driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-pic32.c:857:34: error: ‘pic32_spi_of_match’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-pic32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-pic32.c +1 -1
@@ -863,7 +863,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,
Signature · 1 line
2.34.1
PATCH 11/16 spi: st-ssc4: Drop of_match_ptr for ID table
In reply to Krzysztof KozlowskiThe driver can match only via the DT table so the table should be always used and the of_match_ptr does not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-st-ssc4.c:439:34: error: ‘stm_spi_match’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-st-ssc4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-st-ssc4.c +1 -1
@@ -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,
Signature · 1 line
2.34.1
PATCH 12/16 spi: pxa2xx: Mark OF related data as maybe unused
In reply to Krzysztof KozlowskiThe driver can be compile tested with !CONFIG_OF making certain data unused:
drivers/spi/spi-pxa2xx.c:1757:34: error: ‘pxa2xx_spi_of_match’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-pxa2xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-pxa2xx.c +1 -1
@@ -1754,7 +1754,7 @@ static const struct acpi_device_id pxa2xx_spi_acpi_match[] = {MODULE_DEVICE_TABLE (acpi, pxa2xx_spi_acpi_match);#endif -static const struct of_device_id pxa2xx_spi_of_match[] = { +static const struct of_device_id pxa2xx_spi_of_match[]__maybe_unused = { { .compatible ="marvell,mmp2-ssp" , .data = (void *)MMP2_SSP }, {} };
Signature · 1 line
2.34.1
PATCH 13/16 spi: bcm-qspi: Mark OF related data as maybe unused
In reply to Krzysztof KozlowskiThe driver can be compile tested with !CONFIG_OF making certain data unused:
drivers/spi/spi-bcm-qspi.c:1460:34: error: ‘bcm_qspi_of_match’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-bcm-qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-bcm-qspi.c +1 -1
@@ -1457,7 +1457,7 @@ static const struct bcm_qspi_data bcm_qspi_spcr3_data = { .has_spcr3_sysclk = true, }; -static const struct of_device_id bcm_qspi_of_match[] = { +static const struct of_device_id bcm_qspi_of_match[]__maybe_unused = { { .compatible ="brcm,spi-bcm7445-qspi" , .data = &bcm_qspi_rev_data,
Signature · 1 line
2.34.1
Re: [PATCH 13/16] spi: bcm-qspi: Mark OF related data as maybe unused
Quoted 6 lines · Krzysztof Kozlowski
The driver can be compile tested with !CONFIG_OF making certain data unused:
drivers/spi/spi-bcm-qspi.c:1460:34: error: ‘bcm_qspi_of_match’ defined but not used [-Werror=unused-const-variable=]Signed-off-by Krzysztof Kozlowski <[email protected]>
Signature · 1 line
Florian
PATCH 14/16 spi: sh-msiof: Mark OF related data as maybe unused
In reply to Krzysztof KozlowskiThe driver can be compile tested with !CONFIG_OF making certain data unused:
drivers/spi/spi-sh-msiof.c:1076:34: error: ‘sh_msiof_match’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-sh-msiof.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-sh-msiof.c +1 -1
@@ -1073,7 +1073,7 @@ static const struct sh_msiof_chipdata rcar_gen3_data = { .min_div_pow = 1, }; -static const struct of_device_id sh_msiof_match[] = { +static const struct of_device_id sh_msiof_match[]__maybe_unused = { { .compatible ="renesas,sh-mobile-msiof" , .data = &sh_data }, { .compatible ="renesas,msiof-r8a7743" , .data = &rcar_gen2_data }, { .compatible ="renesas,msiof-r8a7745" , .data = &rcar_gen2_data },
Signature · 1 line
2.34.1
PATCH 15/16 spi: sc18is602: Mark OF related data as maybe unused
In reply to Krzysztof KozlowskiThe driver can be compile tested with !CONFIG_OF making certain data unused:
drivers/spi/spi-sc18is602.c:318:34: error: ‘sc18is602_of_match’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-sc18is602.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-sc18is602.c +1 -1
@@ -315,7 +315,7 @@ static const struct i2c_device_id sc18is602_id[] = { };MODULE_DEVICE_TABLE (i2c, sc18is602_id); -static const struct of_device_id sc18is602_of_match[] = { +static const struct of_device_id sc18is602_of_match[]__maybe_unused = { { .compatible ="nxp,sc18is602" , .data = (void *)sc18is602
Signature · 1 line
2.34.1
PATCH 16/16 spi: rspi: Mark OF related data as maybe unused
In reply to Krzysztof KozlowskiDriver can match via ID or OF ID table, thus several OF-related methods will be unused. Mark the OF structures as __maybe_unused so compiler can drop them:
drivers/spi/spi-rspi.c:1203:29: error: ‘qspi_ops’ defined but not used [-Werror=unused-const-variable=]
--- drivers/spi/spi-rspi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/spi/spi-rspi.c +4 -4
@@ -1190,7 +1190,7 @@ static const struct spi_ops rspi_ops = { .num_hw_ss = 2, }; -static const struct spi_ops rspi_rz_ops = { +static const struct spi_ops rspi_rz_ops__maybe_unused = { .set_config_register = rspi_rz_set_config_register, .transfer_one = rspi_rz_transfer_one, .min_div =2 ,
@@ -1200,7 +1200,7 @@ static const struct spi_ops rspi_rz_ops = { .num_hw_ss = 1, }; -static const struct spi_ops qspi_ops = { +static const struct spi_ops qspi_ops__maybe_unused = { .set_config_register = qspi_set_config_register, .transfer_one = qspi_transfer_one, .extra_mode_bits = SPI_TX_DUAL | SPI_TX_QUAD |
@@ -1212,8 +1212,7 @@ static const struct spi_ops qspi_ops = { .num_hw_ss = 1, }; -#ifdef CONFIG_OF -static const struct of_device_id rspi_of_match[] = { +static const struct of_device_id rspi_of_match[]__maybe_unused = {/* RSPI on legacy SH */ { .compatible ="renesas,rspi" , .data = &rspi_ops },/* RSPI on RZ/A1H */
@@ -1225,6 +1224,7 @@ static const struct of_device_id rspi_of_match[] = {MODULE_DEVICE_TABLE (of, rspi_of_match); +#ifdef CONFIG_OF static void rspi_reset_control_assert (void *data) {reset_control_assert (data);
Signature · 1 line
2.34.1
Mark Brown
maintainerQuoted 5 lines · Krzysztof Kozlowski
The driver can match only via the DT table so the table should be always used and the
of_match_ptrdoes not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-armada-3700.c:807:34: error: ‘a3700_spi_dt_ids’ defined but not used [-Werror=unused-const-variable=]
It would be much better to fix of_match_ptr() and/or the module stuff that also references the match table here.
Quoted 9 lines · Mark Brown
Quoted 5 lines · Krzysztof Kozlowski
The driver can match only via the DT table so the table should be always used and the
of_match_ptrdoes not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-armada-3700.c:807:34: error: ‘a3700_spi_dt_ids’ defined but not used [-Werror=unused-const-variable=]It would be much better to fix
of_match_ptr()and/or the module stuff that also references the match table here.
Why? The recommendation is in general not to use of_match_ptr, because there are little benefits but it disables matching via PRP0001. Jonathan in parallel thread explicitly said of_match_ptr should disappear and he is not accepting any new code with it. And in general he is right.
https://lore.kernel.org/all/20230311183534.1d0dfd64@jic23-huawei/
and earlier:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=444f5f854b35
Best regards,
Krzysztof
Mark Brown
maintainerQuoted 5 lines · Krzysztof Kozlowski
Quoted 3 lines · Mark Brown
Quoted 1 line · Krzysztof Kozlowski
drivers/spi/spi-armada-3700.c:807:34: error: ‘a3700_spi_dt_ids’ defined but not used [-Werror=unused-const-variable=]
Quoted 7 lines
Quoted 2 lines
It would be much better to fix
of_match_ptr()and/or the module stuff that also references the match table here.Why? The recommendation is in general not to use
of_match_ptr, because there are little benefits but it disables matching via PRP0001. Jonathan in parallel thread explicitly saidof_match_ptrshould disappear and he is not accepting any new code with it. And in general he is right.
If that's the case then why are you adding maybe unused annotations for half the drivers rather than removing their of_match_ptr() usages? There doesn't seem to be any logic here, it's just randomly making changes as far as I can tell.
The PRP0001 stuff isn't an issue, of_match_ptr() can just be changed to do the right thing for CONFIG_ACPI. It doesn't buy us huge amounts but it also costs us very little and may be useful in future. When there's missing annotations it's not causing issues for practical configurations as far as I can tell, and if the macro were updated for CONFIG_ACPI it'd be even less of an issue.
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Quoted 14 lines · Mark Brown
Quoted 5 lines · Krzysztof Kozlowski
Quoted 3 lines · Mark Brown
Quoted 1 line · Krzysztof Kozlowski
drivers/spi/spi-armada-3700.c:807:34: error: ‘a3700_spi_dt_ids’ defined but not used [-Werror=unused-const-variable=]Quoted 7 lines
Quoted 2 lines
It would be much better to fix
of_match_ptr()and/or the module stuff that also references the match table here.Why? The recommendation is in general not to use
of_match_ptr, because there are little benefits but it disables matching via PRP0001. Jonathan in parallel thread explicitly saidof_match_ptrshould disappear and he is not accepting any new code with it. And in general he is right.
Quoted 4 lines
If that's the case then why are you adding maybe unused annotations for half the drivers rather than removing their
of_match_ptr()usages? There doesn't seem to be any logic here, it's just randomly making changes as far as I can tell.
These are not random but depend on whether OF is the only matching method or one of few. Although for IIO all of my patches would be dropping the of_match_ptr... For some cases in other patchsets I added __maybe_unused also because of_match_node(), when the table is not used in driver of_match_table.
Quoted 3 lines
The PRP0001 stuff isn't an issue,
of_match_ptr()can just be changed to do the right thing forCONFIG_ACPI.
That's actually interesting idea, kind of obvious so I wonder why it wasn't done like this in the first place in 886ca88be6b3 ("ACPI / bus:
Respect PRP0001 when retrieving device match data"). Maybe not to populate OF device ID tables for the ACPI systems which do not care about PRP0001?
Quoted 5 lines
It doesn't buy us huge amounts but
it also costs us very little and may be useful in future. When there's missing annotations it's not causing issues for practical configurations as far as I can tell, and if the macro were updated forCONFIG_ACPIit'd be even less of an issue.
Best regards,
Krzysztof
Mark Brown
maintainerQuoted 7 lines · Krzysztof Kozlowski
Quoted 4 lines · Mark Brown
If that's the case then why are you adding maybe unused annotations for half the drivers rather than removing their
of_match_ptr()usages? There doesn't seem to be any logic here, it's just randomly making changes as far as I can tell.
Quoted 5 lines
These are not random but depend on whether OF is the only matching method or one of few. Although for IIO all of my patches would be dropping the
of_match_ptr... For some cases in other patchsets I added__maybe_unusedalso becauseof_match_node(), when the table is not used in driverof_match_table.
This logic is both not apparent when looking at the patches and doesn't move us in any particular direction - I'd expect this stuff to be written the same way for all drivers, there's no reason for it to vary. That just adds complication, it's more random obscure rules people have to learn.
Quoted 8 lines
Quoted 2 lines
The PRP0001 stuff isn't an issue,
of_match_ptr()can just be changed to do the right thing forCONFIG_ACPI.That's actually interesting idea, kind of obvious so I wonder why it wasn't done like this in the first place in
886ca88be6b3("ACPI / bus:
Respect PRP0001 when retrieving device match data"). Maybe not to populate OF device ID tables for the ACPI systems which do not care about PRP0001?
Or just it didn't occur to anyone at the time.
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Mark Brown
maintainerRe: (subset) [PATCH 01/16] spi: armada-3700: Drop of_match_ptr for ID table
In reply to Krzysztof KozlowskiQuoted 8 lines · Krzysztof Kozlowski
The driver can match only via the DT table so the table should be always used and the
of_match_ptrdoes not have any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here).
drivers/spi/spi-armada-3700.c:807:34: error: ‘a3700_spi_dt_ids’ defined but not used [-Werror=unused-const-variable=][...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[12/16] spi: pxa2xx: Mark OF related data as maybe unused
commit: d94df25e8b9c8deefc5d7fcd344eb5d4bd41cf7b
[13/16] spi: bcm-qspi: Mark OF related data as maybe unused
commit: 6340fdf2e13c5f1ff3a9622f0cb3b8e9c3955a31
[14/16] spi: sh-msiof: Mark OF related data as maybe unused
commit: d946b6b0ed01949b1a3856e03469361fc9168318
[15/16] spi: sc18is602: Mark OF related data as maybe unused
commit: 833f43308234600e934e9c6fa70fd8b7eebc632b
[16/16] spi: rspi: Mark OF related data as maybe unused
commit: edfa970370a759c2c6a38b2884887937b1aea552All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic