ata: constify of_device_id structures
PATCH 1/1 ata: constify of_device_id structures
Declare of_device_id structures as const as they are either passed to the macro MODULE_DEVICE_TABLE or stored in the of_match_table field of a device_driver structure. This field is of type const, so of_device_id structures having this property can be made const too.
Cross compiled the files drivers/ata/pata_macio.c and drivers/ata/pata_mpc52xx.c for powerpc architecture.
--- drivers/ata/pata_macio.c | 2 +- drivers/ata/pata_mpc52xx.c | 2 +- drivers/ata/pata_of_platform.c | 2 +- drivers/ata/sata_fsl.c | 2 +- drivers/ata/sata_mv.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
drivers/ata/pata_macio.c +1 -1
@@ -1328,7 +1328,7 @@ static int pata_macio_pci_resume(struct pci_dev *pdev) }#endif /* CONFIG_PM_SLEEP */ -static struct of_device_id pata_macio_match[] = +static const struct of_device_id pata_macio_match[] = { { .name ="IDE" ,
drivers/ata/pata_mpc52xx.c +1 -1
@@ -847,7 +847,7 @@ static int mpc52xx_ata_probe(struct platform_device *op) }#endif -static struct of_device_id mpc52xx_ata_of_match[] = { +static const struct of_device_id mpc52xx_ata_of_match[] = { { .compatible ="fsl,mpc5200-ata" , }, { .compatible ="mpc5200-ata" , }, {},
drivers/ata/pata_of_platform.c +1 -1
@@ -67,7 +67,7 @@ static int pata_of_platform_probe(struct platform_device *ofdev) reg_shift, pio_mask, &pata_platform_sht); } -static struct of_device_id pata_of_platform_match[] = { +static const struct of_device_id pata_of_platform_match[] = { { .compatible ="ata-generic" , }, { }, };
drivers/ata/sata_fsl.c +1 -1
@@ -1612,7 +1612,7 @@ static int sata_fsl_resume(struct platform_device *op) }#endif -static struct of_device_id fsl_sata_match[] = { +static const struct of_device_id fsl_sata_match[] = { { .compatible ="fsl,pq-sata" , },
drivers/ata/sata_mv.c +1 -1
@@ -4286,7 +4286,7 @@ static int mv_platform_resume(struct platform_device *pdev)#endif #ifdef CONFIG_OF -static struct of_device_id mv_sata_dt_ids[] = { +static const struct of_device_id mv_sata_dt_ids[] = { { .compatible ="marvell,armada-370-sata" , }, { .compatible ="marvell,orion-sata" , }, {},
Signature · 1 line
1.9.1
Tejun Heo
AppliedQuoted 9 lines · Bhumika Goyal
Declare
of_device_idstructures as const as they are either passed to the macroMODULE_DEVICE_TABLEor stored in theof_match_tablefield of adevice_driverstructure. This field is of type const, soof_device_idstructures having this property can be made const too.Cross compiled the files
drivers/ata/pata_macio.canddrivers/ata/pata_mpc52xx.cfor powerpc architecture.Signed-off-by Bhumika Goyal <[email protected]>
Applied to libata/for-4.12.
Thanks.
Signature · 1 line
tejun