* [PATCH v2] ata: Drop commas after OF match table sentinels
@ 2022-03-03 8:36 Geert Uytterhoeven
2022-03-03 11:40 ` Kieran Bingham
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-03-03 8:36 UTC (permalink / raw)
To: Damien Le Moal
Cc: Hans de Goede, Jens Axboe, Patrice Chotard, Sergey Shtylyov,
Linus Walleij, linux-ide, linux-arm-kernel, linux-renesas-soc,
devicetree, Geert Uytterhoeven, Florian Fainelli
It does not make sense to have a comma after a sentinel, as any new
elements must be added before the sentinel.
Add comments to clarify the purpose of the empty elements.
Rewrap entries to a single line to have a consistent style.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Acked-by: Florian Fainelli <f.fainelli@gmail.com> [ahci_brcm]
---
v2:
- Add Reviewed-by, Acked-by,
- Rewrap entries as requested by Damien.
---
drivers/ata/ahci_brcm.c | 2 +-
drivers/ata/ahci_ceva.c | 2 +-
drivers/ata/ahci_da850.c | 2 +-
drivers/ata/ahci_dm816.c | 2 +-
drivers/ata/ahci_imx.c | 2 +-
drivers/ata/ahci_mtk.c | 2 +-
drivers/ata/ahci_mvebu.c | 2 +-
drivers/ata/ahci_octeon.c | 2 +-
drivers/ata/ahci_platform.c | 2 +-
drivers/ata/ahci_qoriq.c | 2 +-
drivers/ata/ahci_st.c | 2 +-
drivers/ata/ahci_sunxi.c | 2 +-
drivers/ata/ahci_xgene.c | 2 +-
drivers/ata/pata_ftide010.c | 6 ++----
drivers/ata/pata_ixp4xx_cf.c | 2 +-
drivers/ata/pata_macio.c | 18 +++++-------------
drivers/ata/pata_mpc52xx.c | 2 +-
drivers/ata/pata_octeon_cf.c | 6 ++----
drivers/ata/pata_of_platform.c | 2 +-
drivers/ata/sata_fsl.c | 10 +++-------
drivers/ata/sata_gemini.c | 6 ++----
drivers/ata/sata_highbank.c | 2 +-
drivers/ata/sata_mv.c | 2 +-
drivers/ata/sata_rcar.c | 2 +-
24 files changed, 33 insertions(+), 51 deletions(-)
diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index 64dd8aa397d5276b..ab8552b1ff2a14ad 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -427,7 +427,7 @@ static const struct of_device_id ahci_of_match[] = {
{.compatible = "brcm,bcm63138-ahci", .data = (void *)BRCM_SATA_BCM7445},
{.compatible = "brcm,bcm-nsp-ahci", .data = (void *)BRCM_SATA_NSP},
{.compatible = "brcm,bcm7216-ahci", .data = (void *)BRCM_SATA_BCM7216},
- {},
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, ahci_of_match);
diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
index acf59f51b3569d71..cb24ecf36fafe040 100644
--- a/drivers/ata/ahci_ceva.c
+++ b/drivers/ata/ahci_ceva.c
@@ -363,7 +363,7 @@ static SIMPLE_DEV_PM_OPS(ahci_ceva_pm_ops, ceva_ahci_suspend, ceva_ahci_resume);
static const struct of_device_id ceva_ahci_of_match[] = {
{ .compatible = "ceva,ahci-1v84" },
- {},
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, ceva_ahci_of_match);
diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c
index 0e82766007128e72..052c28e250aa8d96 100644
--- a/drivers/ata/ahci_da850.c
+++ b/drivers/ata/ahci_da850.c
@@ -241,7 +241,7 @@ static SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend,
static const struct of_device_id ahci_da850_of_match[] = {
{ .compatible = "ti,da850-ahci", },
- { },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, ahci_da850_of_match);
diff --git a/drivers/ata/ahci_dm816.c b/drivers/ata/ahci_dm816.c
index 8bec4104167142c5..8a92112dcd59080a 100644
--- a/drivers/ata/ahci_dm816.c
+++ b/drivers/ata/ahci_dm816.c
@@ -176,7 +176,7 @@ static SIMPLE_DEV_PM_OPS(ahci_dm816_pm_ops,
static const struct of_device_id ahci_dm816_of_match[] = {
{ .compatible = "ti,dm816-ahci", },
- { },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, ahci_dm816_of_match);
diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
index 388baf528fa81cab..79aa9f2853129f6e 100644
--- a/drivers/ata/ahci_imx.c
+++ b/drivers/ata/ahci_imx.c
@@ -811,7 +811,7 @@ static const struct of_device_id imx_ahci_of_match[] = {
{ .compatible = "fsl,imx6q-ahci", .data = (void *)AHCI_IMX6Q },
{ .compatible = "fsl,imx6qp-ahci", .data = (void *)AHCI_IMX6QP },
{ .compatible = "fsl,imx8qm-ahci", .data = (void *)AHCI_IMX8QM },
- {},
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, imx_ahci_of_match);
diff --git a/drivers/ata/ahci_mtk.c b/drivers/ata/ahci_mtk.c
index d9b08ae7c3b22104..1f6c85fde9830ac1 100644
--- a/drivers/ata/ahci_mtk.c
+++ b/drivers/ata/ahci_mtk.c
@@ -169,7 +169,7 @@ static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend,
static const struct of_device_id ahci_of_match[] = {
{ .compatible = "mediatek,mtk-ahci", },
- {},
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, ahci_of_match);
diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c
index 3ad46d26d9d51790..991413a272e608a2 100644
--- a/drivers/ata/ahci_mvebu.c
+++ b/drivers/ata/ahci_mvebu.c
@@ -239,7 +239,7 @@ static const struct of_device_id ahci_mvebu_of_match[] = {
.compatible = "marvell,armada-3700-ahci",
.data = &ahci_mvebu_armada_3700_plat_data,
},
- { },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, ahci_mvebu_of_match);
diff --git a/drivers/ata/ahci_octeon.c b/drivers/ata/ahci_octeon.c
index 5a44e089c6bb6ae2..b9460b91288f772d 100644
--- a/drivers/ata/ahci_octeon.c
+++ b/drivers/ata/ahci_octeon.c
@@ -80,7 +80,7 @@ static int ahci_octeon_remove(struct platform_device *pdev)
static const struct of_device_id octeon_ahci_match[] = {
{ .compatible = "cavium,octeon-7130-sata-uctl", },
- {},
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, octeon_ahci_match);
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 3aab2e3d57f3373a..28a8de5b48b979c9 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -88,7 +88,7 @@ static const struct of_device_id ahci_of_match[] = {
{ .compatible = "snps,dwc-ahci", },
{ .compatible = "hisilicon,hisi-ahci", },
{ .compatible = "cavium,octeon-7130-ahci", },
- {},
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, ahci_of_match);
diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c
index bf5b388bd4e0db9b..dd612d7963159118 100644
--- a/drivers/ata/ahci_qoriq.c
+++ b/drivers/ata/ahci_qoriq.c
@@ -77,7 +77,7 @@ static const struct of_device_id ahci_qoriq_of_match[] = {
{ .compatible = "fsl,ls1088a-ahci", .data = (void *)AHCI_LS1088A},
{ .compatible = "fsl,ls2088a-ahci", .data = (void *)AHCI_LS2088A},
{ .compatible = "fsl,lx2160a-ahci", .data = (void *)AHCI_LX2160A},
- {},
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, ahci_qoriq_of_match);
diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c
index c268264c2129c52a..7526653c843b3226 100644
--- a/drivers/ata/ahci_st.c
+++ b/drivers/ata/ahci_st.c
@@ -232,7 +232,7 @@ static SIMPLE_DEV_PM_OPS(st_ahci_pm_ops, st_ahci_suspend, st_ahci_resume);
static const struct of_device_id st_ahci_match[] = {
{ .compatible = "st,ahci", },
- {},
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, st_ahci_match);
diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c
index 56b695136977ab72..c7273c1cb0c73b9b 100644
--- a/drivers/ata/ahci_sunxi.c
+++ b/drivers/ata/ahci_sunxi.c
@@ -286,7 +286,7 @@ static SIMPLE_DEV_PM_OPS(ahci_sunxi_pm_ops, ahci_platform_suspend,
static const struct of_device_id ahci_sunxi_of_match[] = {
{ .compatible = "allwinner,sun4i-a10-ahci", },
{ .compatible = "allwinner,sun8i-r40-ahci", },
- { },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, ahci_sunxi_of_match);
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 8e206379d699f080..d205896f66cfb228 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -726,7 +726,7 @@ MODULE_DEVICE_TABLE(acpi, xgene_ahci_acpi_match);
static const struct of_device_id xgene_ahci_of_match[] = {
{.compatible = "apm,xgene-ahci", .data = (void *) XGENE_AHCI_V1},
{.compatible = "apm,xgene-ahci-v2", .data = (void *) XGENE_AHCI_V2},
- {},
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, xgene_ahci_of_match);
diff --git a/drivers/ata/pata_ftide010.c b/drivers/ata/pata_ftide010.c
index 34cb104f6b43e5cf..2e35505b683c7649 100644
--- a/drivers/ata/pata_ftide010.c
+++ b/drivers/ata/pata_ftide010.c
@@ -554,10 +554,8 @@ static int pata_ftide010_remove(struct platform_device *pdev)
}
static const struct of_device_id pata_ftide010_of_match[] = {
- {
- .compatible = "faraday,ftide010",
- },
- {},
+ { .compatible = "faraday,ftide010", },
+ { /* sentinel */ }
};
static struct platform_driver pata_ftide010_driver = {
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 17b557c91e1c78fc..e225913a619d8414 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -293,7 +293,7 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
static const struct of_device_id ixp4xx_pata_of_match[] = {
{ .compatible = "intel,ixp4xx-compact-flash", },
- { },
+ { /* sentinel */ }
};
static struct platform_driver ixp4xx_pata_platform_driver = {
diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
index 16e8aa184a75793f..b986908eaebc4977 100644
--- a/drivers/ata/pata_macio.c
+++ b/drivers/ata/pata_macio.c
@@ -1333,19 +1333,11 @@ static int pata_macio_pci_resume(struct pci_dev *pdev)
static const struct of_device_id pata_macio_match[] =
{
- {
- .name = "IDE",
- },
- {
- .name = "ATA",
- },
- {
- .type = "ide",
- },
- {
- .type = "ata",
- },
- {},
+ { .name = "IDE", },
+ { .name = "ATA", },
+ { .type = "ide", },
+ { .type = "ata", },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, pata_macio_match);
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index f1d352d5f128537a..bc9d9df3b5aced64 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -849,7 +849,7 @@ mpc52xx_ata_resume(struct platform_device *op)
static const struct of_device_id mpc52xx_ata_of_match[] = {
{ .compatible = "fsl,mpc5200-ata", },
{ .compatible = "mpc5200-ata", },
- {},
+ { /* sentinel */ }
};
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index 05c2ab3757568c62..ab264a3a57b0243a 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -1006,10 +1006,8 @@ static void octeon_cf_shutdown(struct device *dev)
}
static const struct of_device_id octeon_cf_match[] = {
- {
- .compatible = "cavium,ebt3000-compact-flash",
- },
- {},
+ { .compatible = "cavium,ebt3000-compact-flash", },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, octeon_cf_match);
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
index c3a40b717dcdcc2a..ac5a633c00a57ac1 100644
--- a/drivers/ata/pata_of_platform.c
+++ b/drivers/ata/pata_of_platform.c
@@ -79,7 +79,7 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
static const struct of_device_id pata_of_platform_match[] = {
{ .compatible = "ata-generic", },
- { },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, pata_of_platform_match);
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 556034a15430461f..9513f22d64749199 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -1577,13 +1577,9 @@ static int sata_fsl_resume(struct platform_device *op)
#endif
static const struct of_device_id fsl_sata_match[] = {
- {
- .compatible = "fsl,pq-sata",
- },
- {
- .compatible = "fsl,pq-sata-v2",
- },
- {},
+ { .compatible = "fsl,pq-sata", },
+ { .compatible = "fsl,pq-sata-v2", },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, fsl_sata_match);
diff --git a/drivers/ata/sata_gemini.c b/drivers/ata/sata_gemini.c
index 440a63de20d01a07..00e1c7941d0ea0dd 100644
--- a/drivers/ata/sata_gemini.c
+++ b/drivers/ata/sata_gemini.c
@@ -419,10 +419,8 @@ static int gemini_sata_remove(struct platform_device *pdev)
}
static const struct of_device_id gemini_sata_of_match[] = {
- {
- .compatible = "cortina,gemini-sata-bridge",
- },
- {},
+ { .compatible = "cortina,gemini-sata-bridge", },
+ { /* sentinel */ }
};
static struct platform_driver gemini_sata_driver = {
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index b29d3f1d64b03317..cd375e4df9644e33 100644
--- a/drivers/ata/sata_highbank.c
+++ b/drivers/ata/sata_highbank.c
@@ -444,7 +444,7 @@ static struct scsi_host_template ahci_highbank_platform_sht = {
static const struct of_device_id ahci_of_match[] = {
{ .compatible = "calxeda,hb-ahci" },
- {},
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, ahci_of_match);
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 53446b997740d5fd..13d92b71e6659cda 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -4277,7 +4277,7 @@ static int mv_platform_resume(struct platform_device *pdev)
static const struct of_device_id mv_sata_dt_ids[] = {
{ .compatible = "marvell,armada-370-sata", },
{ .compatible = "marvell,orion-sata", },
- {},
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, mv_sata_dt_ids);
#endif
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 3d96b6faa3f0e1c6..1483d3efeb7e220e 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -857,7 +857,7 @@ static const struct of_device_id sata_rcar_match[] = {
.compatible = "renesas,rcar-gen3-sata",
.data = (void *)RCAR_GEN3_SATA
},
- { },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, sata_rcar_match);
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2] ata: Drop commas after OF match table sentinels 2022-03-03 8:36 [PATCH v2] ata: Drop commas after OF match table sentinels Geert Uytterhoeven @ 2022-03-03 11:40 ` Kieran Bingham 2022-03-03 12:20 ` Geert Uytterhoeven 2022-03-03 23:10 ` Linus Walleij 2022-03-07 2:53 ` Damien Le Moal 2 siblings, 1 reply; 6+ messages in thread From: Kieran Bingham @ 2022-03-03 11:40 UTC (permalink / raw) To: Damien Le Moal, Geert Uytterhoeven Cc: Hans de Goede, Jens Axboe, Patrice Chotard, Sergey Shtylyov, Linus Walleij, linux-ide, linux-arm-kernel, linux-renesas-soc, devicetree, Geert Uytterhoeven, Florian Fainelli Hi Geert, Quoting Geert Uytterhoeven (2022-03-03 08:36:35) > It does not make sense to have a comma after a sentinel, as any new > elements must be added before the sentinel. Indeed. > Add comments to clarify the purpose of the empty elements. > Rewrap entries to a single line to have a consistent style. Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> git grep "{ }," | wc -l 2638 git grep "{}," | wc -l 2088 Lots of false positives in that basic search, but this looks like a big job. Is this something that could be added to checkstyle? Probably hard to match when it's a sentinal, rather than an initialiser ... so perhaps a coccinelle task. -- Kieran > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> > Acked-by: Florian Fainelli <f.fainelli@gmail.com> [ahci_brcm] > --- > v2: > - Add Reviewed-by, Acked-by, > - Rewrap entries as requested by Damien. > --- > drivers/ata/ahci_brcm.c | 2 +- > drivers/ata/ahci_ceva.c | 2 +- > drivers/ata/ahci_da850.c | 2 +- > drivers/ata/ahci_dm816.c | 2 +- > drivers/ata/ahci_imx.c | 2 +- > drivers/ata/ahci_mtk.c | 2 +- > drivers/ata/ahci_mvebu.c | 2 +- > drivers/ata/ahci_octeon.c | 2 +- > drivers/ata/ahci_platform.c | 2 +- > drivers/ata/ahci_qoriq.c | 2 +- > drivers/ata/ahci_st.c | 2 +- > drivers/ata/ahci_sunxi.c | 2 +- > drivers/ata/ahci_xgene.c | 2 +- > drivers/ata/pata_ftide010.c | 6 ++---- > drivers/ata/pata_ixp4xx_cf.c | 2 +- > drivers/ata/pata_macio.c | 18 +++++------------- > drivers/ata/pata_mpc52xx.c | 2 +- > drivers/ata/pata_octeon_cf.c | 6 ++---- > drivers/ata/pata_of_platform.c | 2 +- > drivers/ata/sata_fsl.c | 10 +++------- > drivers/ata/sata_gemini.c | 6 ++---- > drivers/ata/sata_highbank.c | 2 +- > drivers/ata/sata_mv.c | 2 +- > drivers/ata/sata_rcar.c | 2 +- > 24 files changed, 33 insertions(+), 51 deletions(-) > > diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c > index 64dd8aa397d5276b..ab8552b1ff2a14ad 100644 > --- a/drivers/ata/ahci_brcm.c > +++ b/drivers/ata/ahci_brcm.c > @@ -427,7 +427,7 @@ static const struct of_device_id ahci_of_match[] = { > {.compatible = "brcm,bcm63138-ahci", .data = (void *)BRCM_SATA_BCM7445}, > {.compatible = "brcm,bcm-nsp-ahci", .data = (void *)BRCM_SATA_NSP}, > {.compatible = "brcm,bcm7216-ahci", .data = (void *)BRCM_SATA_BCM7216}, > - {}, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, ahci_of_match); > > diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c > index acf59f51b3569d71..cb24ecf36fafe040 100644 > --- a/drivers/ata/ahci_ceva.c > +++ b/drivers/ata/ahci_ceva.c > @@ -363,7 +363,7 @@ static SIMPLE_DEV_PM_OPS(ahci_ceva_pm_ops, ceva_ahci_suspend, ceva_ahci_resume); > > static const struct of_device_id ceva_ahci_of_match[] = { > { .compatible = "ceva,ahci-1v84" }, > - {}, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, ceva_ahci_of_match); > > diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c > index 0e82766007128e72..052c28e250aa8d96 100644 > --- a/drivers/ata/ahci_da850.c > +++ b/drivers/ata/ahci_da850.c > @@ -241,7 +241,7 @@ static SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend, > > static const struct of_device_id ahci_da850_of_match[] = { > { .compatible = "ti,da850-ahci", }, > - { }, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, ahci_da850_of_match); > > diff --git a/drivers/ata/ahci_dm816.c b/drivers/ata/ahci_dm816.c > index 8bec4104167142c5..8a92112dcd59080a 100644 > --- a/drivers/ata/ahci_dm816.c > +++ b/drivers/ata/ahci_dm816.c > @@ -176,7 +176,7 @@ static SIMPLE_DEV_PM_OPS(ahci_dm816_pm_ops, > > static const struct of_device_id ahci_dm816_of_match[] = { > { .compatible = "ti,dm816-ahci", }, > - { }, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, ahci_dm816_of_match); > > diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c > index 388baf528fa81cab..79aa9f2853129f6e 100644 > --- a/drivers/ata/ahci_imx.c > +++ b/drivers/ata/ahci_imx.c > @@ -811,7 +811,7 @@ static const struct of_device_id imx_ahci_of_match[] = { > { .compatible = "fsl,imx6q-ahci", .data = (void *)AHCI_IMX6Q }, > { .compatible = "fsl,imx6qp-ahci", .data = (void *)AHCI_IMX6QP }, > { .compatible = "fsl,imx8qm-ahci", .data = (void *)AHCI_IMX8QM }, > - {}, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, imx_ahci_of_match); > > diff --git a/drivers/ata/ahci_mtk.c b/drivers/ata/ahci_mtk.c > index d9b08ae7c3b22104..1f6c85fde9830ac1 100644 > --- a/drivers/ata/ahci_mtk.c > +++ b/drivers/ata/ahci_mtk.c > @@ -169,7 +169,7 @@ static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend, > > static const struct of_device_id ahci_of_match[] = { > { .compatible = "mediatek,mtk-ahci", }, > - {}, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, ahci_of_match); > > diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c > index 3ad46d26d9d51790..991413a272e608a2 100644 > --- a/drivers/ata/ahci_mvebu.c > +++ b/drivers/ata/ahci_mvebu.c > @@ -239,7 +239,7 @@ static const struct of_device_id ahci_mvebu_of_match[] = { > .compatible = "marvell,armada-3700-ahci", > .data = &ahci_mvebu_armada_3700_plat_data, > }, > - { }, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, ahci_mvebu_of_match); > > diff --git a/drivers/ata/ahci_octeon.c b/drivers/ata/ahci_octeon.c > index 5a44e089c6bb6ae2..b9460b91288f772d 100644 > --- a/drivers/ata/ahci_octeon.c > +++ b/drivers/ata/ahci_octeon.c > @@ -80,7 +80,7 @@ static int ahci_octeon_remove(struct platform_device *pdev) > > static const struct of_device_id octeon_ahci_match[] = { > { .compatible = "cavium,octeon-7130-sata-uctl", }, > - {}, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, octeon_ahci_match); > > diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c > index 3aab2e3d57f3373a..28a8de5b48b979c9 100644 > --- a/drivers/ata/ahci_platform.c > +++ b/drivers/ata/ahci_platform.c > @@ -88,7 +88,7 @@ static const struct of_device_id ahci_of_match[] = { > { .compatible = "snps,dwc-ahci", }, > { .compatible = "hisilicon,hisi-ahci", }, > { .compatible = "cavium,octeon-7130-ahci", }, > - {}, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, ahci_of_match); > > diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c > index bf5b388bd4e0db9b..dd612d7963159118 100644 > --- a/drivers/ata/ahci_qoriq.c > +++ b/drivers/ata/ahci_qoriq.c > @@ -77,7 +77,7 @@ static const struct of_device_id ahci_qoriq_of_match[] = { > { .compatible = "fsl,ls1088a-ahci", .data = (void *)AHCI_LS1088A}, > { .compatible = "fsl,ls2088a-ahci", .data = (void *)AHCI_LS2088A}, > { .compatible = "fsl,lx2160a-ahci", .data = (void *)AHCI_LX2160A}, > - {}, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, ahci_qoriq_of_match); > > diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c > index c268264c2129c52a..7526653c843b3226 100644 > --- a/drivers/ata/ahci_st.c > +++ b/drivers/ata/ahci_st.c > @@ -232,7 +232,7 @@ static SIMPLE_DEV_PM_OPS(st_ahci_pm_ops, st_ahci_suspend, st_ahci_resume); > > static const struct of_device_id st_ahci_match[] = { > { .compatible = "st,ahci", }, > - {}, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, st_ahci_match); > > diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c > index 56b695136977ab72..c7273c1cb0c73b9b 100644 > --- a/drivers/ata/ahci_sunxi.c > +++ b/drivers/ata/ahci_sunxi.c > @@ -286,7 +286,7 @@ static SIMPLE_DEV_PM_OPS(ahci_sunxi_pm_ops, ahci_platform_suspend, > static const struct of_device_id ahci_sunxi_of_match[] = { > { .compatible = "allwinner,sun4i-a10-ahci", }, > { .compatible = "allwinner,sun8i-r40-ahci", }, > - { }, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, ahci_sunxi_of_match); > > diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c > index 8e206379d699f080..d205896f66cfb228 100644 > --- a/drivers/ata/ahci_xgene.c > +++ b/drivers/ata/ahci_xgene.c > @@ -726,7 +726,7 @@ MODULE_DEVICE_TABLE(acpi, xgene_ahci_acpi_match); > static const struct of_device_id xgene_ahci_of_match[] = { > {.compatible = "apm,xgene-ahci", .data = (void *) XGENE_AHCI_V1}, > {.compatible = "apm,xgene-ahci-v2", .data = (void *) XGENE_AHCI_V2}, > - {}, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, xgene_ahci_of_match); > > diff --git a/drivers/ata/pata_ftide010.c b/drivers/ata/pata_ftide010.c > index 34cb104f6b43e5cf..2e35505b683c7649 100644 > --- a/drivers/ata/pata_ftide010.c > +++ b/drivers/ata/pata_ftide010.c > @@ -554,10 +554,8 @@ static int pata_ftide010_remove(struct platform_device *pdev) > } > > static const struct of_device_id pata_ftide010_of_match[] = { > - { > - .compatible = "faraday,ftide010", > - }, > - {}, > + { .compatible = "faraday,ftide010", }, > + { /* sentinel */ } > }; > > static struct platform_driver pata_ftide010_driver = { > diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c > index 17b557c91e1c78fc..e225913a619d8414 100644 > --- a/drivers/ata/pata_ixp4xx_cf.c > +++ b/drivers/ata/pata_ixp4xx_cf.c > @@ -293,7 +293,7 @@ static int ixp4xx_pata_probe(struct platform_device *pdev) > > static const struct of_device_id ixp4xx_pata_of_match[] = { > { .compatible = "intel,ixp4xx-compact-flash", }, > - { }, > + { /* sentinel */ } > }; > > static struct platform_driver ixp4xx_pata_platform_driver = { > diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c > index 16e8aa184a75793f..b986908eaebc4977 100644 > --- a/drivers/ata/pata_macio.c > +++ b/drivers/ata/pata_macio.c > @@ -1333,19 +1333,11 @@ static int pata_macio_pci_resume(struct pci_dev *pdev) > > static const struct of_device_id pata_macio_match[] = > { > - { > - .name = "IDE", > - }, > - { > - .name = "ATA", > - }, > - { > - .type = "ide", > - }, > - { > - .type = "ata", > - }, > - {}, > + { .name = "IDE", }, > + { .name = "ATA", }, > + { .type = "ide", }, > + { .type = "ata", }, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, pata_macio_match); > > diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c > index f1d352d5f128537a..bc9d9df3b5aced64 100644 > --- a/drivers/ata/pata_mpc52xx.c > +++ b/drivers/ata/pata_mpc52xx.c > @@ -849,7 +849,7 @@ mpc52xx_ata_resume(struct platform_device *op) > static const struct of_device_id mpc52xx_ata_of_match[] = { > { .compatible = "fsl,mpc5200-ata", }, > { .compatible = "mpc5200-ata", }, > - {}, > + { /* sentinel */ } > }; > > > diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c > index 05c2ab3757568c62..ab264a3a57b0243a 100644 > --- a/drivers/ata/pata_octeon_cf.c > +++ b/drivers/ata/pata_octeon_cf.c > @@ -1006,10 +1006,8 @@ static void octeon_cf_shutdown(struct device *dev) > } > > static const struct of_device_id octeon_cf_match[] = { > - { > - .compatible = "cavium,ebt3000-compact-flash", > - }, > - {}, > + { .compatible = "cavium,ebt3000-compact-flash", }, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, octeon_cf_match); > > diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c > index c3a40b717dcdcc2a..ac5a633c00a57ac1 100644 > --- a/drivers/ata/pata_of_platform.c > +++ b/drivers/ata/pata_of_platform.c > @@ -79,7 +79,7 @@ static int pata_of_platform_probe(struct platform_device *ofdev) > > static const struct of_device_id pata_of_platform_match[] = { > { .compatible = "ata-generic", }, > - { }, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, pata_of_platform_match); > > diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c > index 556034a15430461f..9513f22d64749199 100644 > --- a/drivers/ata/sata_fsl.c > +++ b/drivers/ata/sata_fsl.c > @@ -1577,13 +1577,9 @@ static int sata_fsl_resume(struct platform_device *op) > #endif > > static const struct of_device_id fsl_sata_match[] = { > - { > - .compatible = "fsl,pq-sata", > - }, > - { > - .compatible = "fsl,pq-sata-v2", > - }, > - {}, > + { .compatible = "fsl,pq-sata", }, > + { .compatible = "fsl,pq-sata-v2", }, > + { /* sentinel */ } > }; > > MODULE_DEVICE_TABLE(of, fsl_sata_match); > diff --git a/drivers/ata/sata_gemini.c b/drivers/ata/sata_gemini.c > index 440a63de20d01a07..00e1c7941d0ea0dd 100644 > --- a/drivers/ata/sata_gemini.c > +++ b/drivers/ata/sata_gemini.c > @@ -419,10 +419,8 @@ static int gemini_sata_remove(struct platform_device *pdev) > } > > static const struct of_device_id gemini_sata_of_match[] = { > - { > - .compatible = "cortina,gemini-sata-bridge", > - }, > - {}, > + { .compatible = "cortina,gemini-sata-bridge", }, > + { /* sentinel */ } > }; > > static struct platform_driver gemini_sata_driver = { > diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c > index b29d3f1d64b03317..cd375e4df9644e33 100644 > --- a/drivers/ata/sata_highbank.c > +++ b/drivers/ata/sata_highbank.c > @@ -444,7 +444,7 @@ static struct scsi_host_template ahci_highbank_platform_sht = { > > static const struct of_device_id ahci_of_match[] = { > { .compatible = "calxeda,hb-ahci" }, > - {}, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, ahci_of_match); > > diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c > index 53446b997740d5fd..13d92b71e6659cda 100644 > --- a/drivers/ata/sata_mv.c > +++ b/drivers/ata/sata_mv.c > @@ -4277,7 +4277,7 @@ static int mv_platform_resume(struct platform_device *pdev) > static const struct of_device_id mv_sata_dt_ids[] = { > { .compatible = "marvell,armada-370-sata", }, > { .compatible = "marvell,orion-sata", }, > - {}, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, mv_sata_dt_ids); > #endif > diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c > index 3d96b6faa3f0e1c6..1483d3efeb7e220e 100644 > --- a/drivers/ata/sata_rcar.c > +++ b/drivers/ata/sata_rcar.c > @@ -857,7 +857,7 @@ static const struct of_device_id sata_rcar_match[] = { > .compatible = "renesas,rcar-gen3-sata", > .data = (void *)RCAR_GEN3_SATA > }, > - { }, > + { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, sata_rcar_match); > > -- > 2.25.1 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] ata: Drop commas after OF match table sentinels 2022-03-03 11:40 ` Kieran Bingham @ 2022-03-03 12:20 ` Geert Uytterhoeven 2022-03-03 12:24 ` Damien Le Moal 0 siblings, 1 reply; 6+ messages in thread From: Geert Uytterhoeven @ 2022-03-03 12:20 UTC (permalink / raw) To: Kieran Bingham Cc: Damien Le Moal, Hans de Goede, Jens Axboe, Patrice Chotard, Sergey Shtylyov, Linus Walleij, linux-ide, Linux ARM, Linux-Renesas, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, Florian Fainelli Hi Kieran, On Thu, Mar 3, 2022 at 12:40 PM Kieran Bingham <kieran.bingham@ideasonboard.com> wrote: > Quoting Geert Uytterhoeven (2022-03-03 08:36:35) > > It does not make sense to have a comma after a sentinel, as any new > > elements must be added before the sentinel. > > Indeed. > > > Add comments to clarify the purpose of the empty elements. > > Rewrap entries to a single line to have a consistent style. > > Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Thanks! > git grep "{ }," | wc -l > 2638 > git grep "{}," | wc -l > 2088 > > Lots of false positives in that basic search, but this looks like a big > job. Is this something that could be added to checkstyle? > > Probably hard to match when it's a sentinal, rather than an initialiser > ... so perhaps a coccinelle task. Yes, there are _lots_ of these. I fixed the ca. 50 cases involving Renesas-specific compatible values, and picked up the ata subsystem for a first run. But fixing all of them looks like a lot of work, so automation might help. For soc_device_attribute tables, there are less cases, so I'll just send the handful patches to fix all of them... Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] ata: Drop commas after OF match table sentinels 2022-03-03 12:20 ` Geert Uytterhoeven @ 2022-03-03 12:24 ` Damien Le Moal 0 siblings, 0 replies; 6+ messages in thread From: Damien Le Moal @ 2022-03-03 12:24 UTC (permalink / raw) To: Geert Uytterhoeven, Kieran Bingham Cc: Hans de Goede, Jens Axboe, Patrice Chotard, Sergey Shtylyov, Linus Walleij, linux-ide, Linux ARM, Linux-Renesas, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, Florian Fainelli On 2022/03/03 14:20, Geert Uytterhoeven wrote: > Hi Kieran, > > On Thu, Mar 3, 2022 at 12:40 PM Kieran Bingham > <kieran.bingham@ideasonboard.com> wrote: >> Quoting Geert Uytterhoeven (2022-03-03 08:36:35) >>> It does not make sense to have a comma after a sentinel, as any new >>> elements must be added before the sentinel. >> >> Indeed. >> >>> Add comments to clarify the purpose of the empty elements. >>> Rewrap entries to a single line to have a consistent style. >> >> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> > > Thanks! > >> > git grep "{ }," | wc -l >> 2638 >> git grep "{}," | wc -l >> 2088 >> >> Lots of false positives in that basic search, but this looks like a big >> job. Is this something that could be added to checkstyle? >> >> Probably hard to match when it's a sentinal, rather than an initialiser >> ... so perhaps a coccinelle task. > > Yes, there are _lots_ of these. > > I fixed the ca. 50 cases involving Renesas-specific compatible values, > and picked up the ata subsystem for a first run. But fixing all of them > looks like a lot of work, so automation might help. Thanks for the cleanup Geert. Will apply. > > For soc_device_attribute tables, there are less cases, so I'll just > send the handful patches to fix all of them... > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds -- Damien Le Moal Western Digital Research ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] ata: Drop commas after OF match table sentinels 2022-03-03 8:36 [PATCH v2] ata: Drop commas after OF match table sentinels Geert Uytterhoeven 2022-03-03 11:40 ` Kieran Bingham @ 2022-03-03 23:10 ` Linus Walleij 2022-03-07 2:53 ` Damien Le Moal 2 siblings, 0 replies; 6+ messages in thread From: Linus Walleij @ 2022-03-03 23:10 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Damien Le Moal, Hans de Goede, Jens Axboe, Patrice Chotard, Sergey Shtylyov, linux-ide, linux-arm-kernel, linux-renesas-soc, devicetree, Florian Fainelli On Thu, Mar 3, 2022 at 12:03 PM Geert Uytterhoeven <geert+renesas@glider.be> wrote: > It does not make sense to have a comma after a sentinel, as any new > elements must be added before the sentinel. > > Add comments to clarify the purpose of the empty elements. > Rewrap entries to a single line to have a consistent style. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> > Acked-by: Florian Fainelli <f.fainelli@gmail.com> [ahci_brcm] This looks so much better. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] ata: Drop commas after OF match table sentinels 2022-03-03 8:36 [PATCH v2] ata: Drop commas after OF match table sentinels Geert Uytterhoeven 2022-03-03 11:40 ` Kieran Bingham 2022-03-03 23:10 ` Linus Walleij @ 2022-03-07 2:53 ` Damien Le Moal 2 siblings, 0 replies; 6+ messages in thread From: Damien Le Moal @ 2022-03-07 2:53 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Hans de Goede, Jens Axboe, Patrice Chotard, Sergey Shtylyov, Linus Walleij, linux-ide, linux-arm-kernel, linux-renesas-soc, devicetree, Florian Fainelli On 3/3/22 17:36, Geert Uytterhoeven wrote: > It does not make sense to have a comma after a sentinel, as any new > elements must be added before the sentinel. > > Add comments to clarify the purpose of the empty elements. > Rewrap entries to a single line to have a consistent style. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> > Acked-by: Florian Fainelli <f.fainelli@gmail.com> [ahci_brcm] > --- > v2: > - Add Reviewed-by, Acked-by, > - Rewrap entries as requested by Damien. Applied to for^5.18. Thanks ! -- Damien Le Moal Western Digital Research ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-03-07 2:53 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-03-03 8:36 [PATCH v2] ata: Drop commas after OF match table sentinels Geert Uytterhoeven 2022-03-03 11:40 ` Kieran Bingham 2022-03-03 12:20 ` Geert Uytterhoeven 2022-03-03 12:24 ` Damien Le Moal 2022-03-03 23:10 ` Linus Walleij 2022-03-07 2:53 ` Damien Le Moal
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox