Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Bhumika Goyal and committed by
Tejun Heo
e3779f6a c1ae3cfa

+5 -5
+1 -1
drivers/ata/pata_macio.c
··· 1328 1328 } 1329 1329 #endif /* CONFIG_PM_SLEEP */ 1330 1330 1331 - static struct of_device_id pata_macio_match[] = 1331 + static const struct of_device_id pata_macio_match[] = 1332 1332 { 1333 1333 { 1334 1334 .name = "IDE",
+1 -1
drivers/ata/pata_mpc52xx.c
··· 847 847 } 848 848 #endif 849 849 850 - static struct of_device_id mpc52xx_ata_of_match[] = { 850 + static const struct of_device_id mpc52xx_ata_of_match[] = { 851 851 { .compatible = "fsl,mpc5200-ata", }, 852 852 { .compatible = "mpc5200-ata", }, 853 853 {},
+1 -1
drivers/ata/pata_of_platform.c
··· 67 67 reg_shift, pio_mask, &pata_platform_sht); 68 68 } 69 69 70 - static struct of_device_id pata_of_platform_match[] = { 70 + static const struct of_device_id pata_of_platform_match[] = { 71 71 { .compatible = "ata-generic", }, 72 72 { }, 73 73 };
+1 -1
drivers/ata/sata_fsl.c
··· 1612 1612 } 1613 1613 #endif 1614 1614 1615 - static struct of_device_id fsl_sata_match[] = { 1615 + static const struct of_device_id fsl_sata_match[] = { 1616 1616 { 1617 1617 .compatible = "fsl,pq-sata", 1618 1618 },
+1 -1
drivers/ata/sata_mv.c
··· 4286 4286 #endif 4287 4287 4288 4288 #ifdef CONFIG_OF 4289 - static struct of_device_id mv_sata_dt_ids[] = { 4289 + static const struct of_device_id mv_sata_dt_ids[] = { 4290 4290 { .compatible = "marvell,armada-370-sata", }, 4291 4291 { .compatible = "marvell,orion-sata", }, 4292 4292 {},