constify parisc parisc_device_id
cover constify parisc parisc_device_id
parisc_device_id are not supposed to change at runtime. All functions working with parisc_device_id provided by <asm/parisc-device.h> work with const parisc_device_id. So mark the non-const structs as const.
Arvind Yadav (8):
[PATCH 1/8] parisc: asp: constify parisc_device_id [PATCH 2/8] parisc: ccio: constify parisc_device_id [PATCH 3/8] parisc: dino: constify parisc_device_id [PATCH 4/8] parisc: hppb: constify parisc_device_id [PATCH 5/8] parisc: lasi: constify parisc_device_id [PATCH 6/8] parisc: lba_pci: constify parisc_device_id [PATCH 7/8] parisc: sba_iommu: constify parisc_device_id [PATCH 8/8] parisc: wax: constify parisc_device_id
drivers/parisc/asp.c | 2 +- drivers/parisc/ccio-rm-dma.c | 2 +- drivers/parisc/dino.c | 2 +- drivers/parisc/hppb.c | 2 +- drivers/parisc/lasi.c | 2 +- drivers/parisc/lba_pci.c | 2 +- drivers/parisc/sba_iommu.c | 2 +- drivers/parisc/wax.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/8 parisc: asp: constify parisc_device_id
parisc_device_id are not supposed to change at runtime. All functions working with parisc_device_id provided by <asm/parisc-device.h> work with const parisc_device_id. So mark the non-const structs as const.
--- drivers/parisc/asp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parisc/asp.c +1 -1
@@ -118,7 +118,7 @@ static int __init asp_init_chip(struct parisc_device *dev)return ret; } -static struct parisc_device_id asp_tbl[] = { +static const struct parisc_device_id asp_tbl[] = { {HPHW_BA ,HVERSION_REV_ANY_ID ,HVERSION_ANY_ID ,0x00070 }, {0 , } };
Signature · 1 line
2.7.4
PATCH 2/8 parisc: ccio: constify parisc_device_id
In reply to Arvind Yadavparisc_device_id are not supposed to change at runtime. All functions working with parisc_device_id provided by <asm/parisc-device.h> work with const parisc_device_id. So mark the non-const structs as const.
--- drivers/parisc/ccio-rm-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parisc/ccio-rm-dma.c +1 -1
@@ -184,7 +184,7 @@ ccio_probe(struct parisc_device *dev)return 0 ; } -static struct parisc_device_id ccio_tbl[] = { +static const struct parisc_device_id ccio_tbl[] = { {HPHW_BCPORT ,HVERSION_REV_ANY_ID ,U2_BC_GSC ,0xc }, {HPHW_BCPORT ,HVERSION_REV_ANY_ID ,UTURN_BC_GSC ,0xc }, {0 , }
Signature · 1 line
2.7.4
PATCH 3/8 parisc: dino: constify parisc_device_id
In reply to Arvind Yadavparisc_device_id are not supposed to change at runtime. All functions working with parisc_device_id provided by <asm/parisc-device.h> work with const parisc_device_id. So mark the non-const structs as const.
--- drivers/parisc/dino.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parisc/dino.c +1 -1
@@ -1022,7 +1022,7 @@ static int __init dino_probe(struct parisc_device *dev)* and 725 firmware misreport it as 0x08080 for no adequately explained * reason. */ -static struct parisc_device_id dino_tbl[] = { +static const struct parisc_device_id dino_tbl[] = { {HPHW_A_DMA ,HVERSION_REV_ANY_ID ,0x004 ,0x0009D },/* Card-mode Dino */ {HPHW_A_DMA ,HVERSION_REV_ANY_ID ,HVERSION_ANY_ID ,0x08080 },/* XXX */ {HPHW_BRIDGE ,HVERSION_REV_ANY_ID ,0x680 ,0xa },/* Bridge-mode Dino */
Signature · 1 line
2.7.4
PATCH 4/8 parisc: hppb: constify parisc_device_id
In reply to Arvind Yadavparisc_device_id are not supposed to change at runtime. All functions working with parisc_device_id provided by <asm/parisc-device.h> work with const parisc_device_id. So mark the non-const structs as const.
--- drivers/parisc/hppb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parisc/hppb.c +1 -1
@@ -81,7 +81,7 @@ static int hppb_probe(struct parisc_device *dev)return 0 ; } -static struct parisc_device_id hppb_tbl[] = { +static const struct parisc_device_id hppb_tbl[] = { {HPHW_BCPORT ,HVERSION_REV_ANY_ID ,0x500 ,0xc },/* E25 and K */ {HPHW_BCPORT ,0x0 ,0x501 ,0xc },/* E35 */ {HPHW_BCPORT ,0x0 ,0x502 ,0xc },/* E45 */
Signature · 1 line
2.7.4
PATCH 5/8 parisc: lasi: constify parisc_device_id
In reply to Arvind Yadavparisc_device_id are not supposed to change at runtime. All functions working with parisc_device_id provided by <asm/parisc-device.h> work with const parisc_device_id. So mark the non-const structs as const.
--- drivers/parisc/lasi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parisc/lasi.c +1 -1
@@ -227,7 +227,7 @@ static int __init lasi_init_chip(struct parisc_device *dev)return ret; } -static struct parisc_device_id lasi_tbl[] = { +static const struct parisc_device_id lasi_tbl[] = { {HPHW_BA ,HVERSION_REV_ANY_ID ,HVERSION_ANY_ID ,0x00081 }, {0 , } };
Signature · 1 line
2.7.4
PATCH 6/8 parisc: lba_pci: constify parisc_device_id
In reply to Arvind Yadavparisc_device_id are not supposed to change at runtime. All functions working with parisc_device_id provided by <asm/parisc-device.h> work with const parisc_device_id. So mark the non-const structs as const.
--- drivers/parisc/lba_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parisc/lba_pci.c +1 -1
@@ -1613,7 +1613,7 @@ lba_driver_probe(struct parisc_device *dev)return 0 ; } -static struct parisc_device_id lba_tbl[] = { +static const struct parisc_device_id lba_tbl[] = { {HPHW_BRIDGE ,HVERSION_REV_ANY_ID ,ELROY_HVERS ,0xa }, {HPHW_BRIDGE ,HVERSION_REV_ANY_ID ,MERCURY_HVERS ,0xa }, {HPHW_BRIDGE ,HVERSION_REV_ANY_ID ,QUICKSILVER_HVERS ,0xa },
Signature · 1 line
2.7.4
PATCH 7/8 parisc: sba_iommu: constify parisc_device_id
In reply to Arvind Yadavparisc_device_id are not supposed to change at runtime. All functions working with parisc_device_id provided by <asm/parisc-device.h> work with const parisc_device_id. So mark the non-const structs as const.
--- drivers/parisc/sba_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parisc/sba_iommu.c +1 -1
@@ -1905,7 +1905,7 @@ static const struct file_operations sba_proc_bitmap_fops = { };#endif /* CONFIG_PROC_FS */ -static struct parisc_device_id sba_tbl[] = { +static const struct parisc_device_id sba_tbl[] = { {HPHW_IOA ,HVERSION_REV_ANY_ID ,ASTRO_RUNWAY_PORT ,0xb }, {HPHW_BCPORT ,HVERSION_REV_ANY_ID ,IKE_MERCED_PORT ,0xc }, {HPHW_BCPORT ,HVERSION_REV_ANY_ID ,REO_MERCED_PORT ,0xc },
Signature · 1 line
2.7.4
PATCH 8/8 parisc: wax: constify parisc_device_id
In reply to Arvind Yadavparisc_device_id are not supposed to change at runtime. All functions working with parisc_device_id provided by <asm/parisc-device.h> work with const parisc_device_id. So mark the non-const structs as const.
--- drivers/parisc/wax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parisc/wax.c +1 -1
@@ -125,7 +125,7 @@ static int __init wax_init_chip(struct parisc_device *dev)return ret; } -static struct parisc_device_id wax_tbl[] = { +static const struct parisc_device_id wax_tbl[] = { {HPHW_BA ,HVERSION_REV_ANY_ID ,HVERSION_ANY_ID ,0x0008e }, {0 , } };
Signature · 1 line
2.7.4
Helge Deller
maintainerHi Arvind,
Quoted 3 lines · Arvind Yadav
parisc_device_idare not supposed to change at runtime. All functions working withparisc_device_idprovided by <asm/parisc-device.h> work with constparisc_device_id. So mark the non-const structs as const.
Basically your patches are correct, but those structs aren't used after bootup any longer.
So, they are much better placed in the __initconst or __initdata sections so that they get dropped before the kernel enters userspace. Changing it to __initconst includes more changes to those files than just changing one line.
So, I won't apply your patches.
Instead I've hacked up new versions in my tree which move those to __init* sections.
Anyway, thanks for your patches!
Helge
Quoted 20 lines
Arvind Yadav (8):
[PATCH 1/8] parisc: asp: constifyparisc_device_id[PATCH 2/8] parisc: ccio: constifyparisc_device_id[PATCH 3/8] parisc: dino: constifyparisc_device_id[PATCH 4/8] parisc: hppb: constifyparisc_device_id[PATCH 5/8] parisc: lasi: constifyparisc_device_id[PATCH 6/8] parisc:lba_pci: constifyparisc_device_id[PATCH 7/8] parisc:sba_iommu: constifyparisc_device_id[PATCH 8/8] parisc: wax: constifyparisc_device_iddrivers/parisc/asp.c | 2 +- drivers/parisc/ccio-rm-dma.c | 2 +- drivers/parisc/dino.c | 2 +- drivers/parisc/hppb.c | 2 +- drivers/parisc/lasi.c | 2 +- drivers/parisc/lba_pci.c | 2 +- drivers/parisc/sba_iommu.c | 2 +- drivers/parisc/wax.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)