Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1715698 > unrolled thread
| Started by | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| First post | 2017-08-19 19:50 +0200 |
| Last post | 2017-08-21 22:50 +0200 |
| Articles | 10 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/8] constify parisc parisc_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 19:50 +0200
[PATCH 6/8] parisc: lba_pci: constify parisc_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 19:50 +0200
[PATCH 5/8] parisc: lasi: constify parisc_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 19:50 +0200
[PATCH 2/8] parisc: ccio: constify parisc_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 19:50 +0200
[PATCH 1/8] parisc: asp: constify parisc_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 19:50 +0200
[PATCH 7/8] parisc: sba_iommu: constify parisc_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 19:50 +0200
[PATCH 3/8] parisc: dino: constify parisc_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 19:50 +0200
[PATCH 8/8] parisc: wax: constify parisc_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 19:50 +0200
[PATCH 4/8] parisc: hppb: constify parisc_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 19:50 +0200
Re: [PATCH 0/8] constify parisc parisc_device_id Helge Deller <deller@gmx.de> - 2017-08-21 22:50 +0200
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-19 19:50 +0200 |
| Subject | [PATCH 0/8] constify parisc parisc_device_id |
| Message-ID | <ugg2J-4fr-1@gated-at.bofh.it> |
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(-) -- 2.7.4
[toc] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-19 19:50 +0200 |
| Subject | [PATCH 6/8] parisc: lba_pci: constify parisc_device_id |
| Message-ID | <ugg2J-4fr-5@gated-at.bofh.it> |
| In reply to | #1715698 |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/parisc/lba_pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index bc286cb..9d6179e 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -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 },
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-19 19:50 +0200 |
| Subject | [PATCH 5/8] parisc: lasi: constify parisc_device_id |
| Message-ID | <ugg2J-4fr-11@gated-at.bofh.it> |
| In reply to | #1715698 |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/parisc/lasi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/parisc/lasi.c b/drivers/parisc/lasi.c
index e65727c..b77cf1e 100644
--- a/drivers/parisc/lasi.c
+++ b/drivers/parisc/lasi.c
@@ -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, }
};
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-19 19:50 +0200 |
| Subject | [PATCH 2/8] parisc: ccio: constify parisc_device_id |
| Message-ID | <ugg2K-4fr-17@gated-at.bofh.it> |
| In reply to | #1715698 |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/parisc/ccio-rm-dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/parisc/ccio-rm-dma.c b/drivers/parisc/ccio-rm-dma.c
index 1bf9880..fc8fbb5 100644
--- a/drivers/parisc/ccio-rm-dma.c
+++ b/drivers/parisc/ccio-rm-dma.c
@@ -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, }
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-19 19:50 +0200 |
| Subject | [PATCH 1/8] parisc: asp: constify parisc_device_id |
| Message-ID | <ugg2J-4fr-13@gated-at.bofh.it> |
| In reply to | #1715698 |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/parisc/asp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/parisc/asp.c b/drivers/parisc/asp.c
index 6a1ab25..4ad32e1 100644
--- a/drivers/parisc/asp.c
+++ b/drivers/parisc/asp.c
@@ -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, }
};
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-19 19:50 +0200 |
| Subject | [PATCH 7/8] parisc: sba_iommu: constify parisc_device_id |
| Message-ID | <ugg2K-4fr-15@gated-at.bofh.it> |
| In reply to | #1715698 |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/parisc/sba_iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 4086f79..1bad85c 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -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 },
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-19 19:50 +0200 |
| Subject | [PATCH 3/8] parisc: dino: constify parisc_device_id |
| Message-ID | <ugg2K-4fr-21@gated-at.bofh.it> |
| In reply to | #1715698 |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/parisc/dino.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index 5c63b92..19c5c9a 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -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 */
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-19 19:50 +0200 |
| Subject | [PATCH 8/8] parisc: wax: constify parisc_device_id |
| Message-ID | <ugg2K-4fr-23@gated-at.bofh.it> |
| In reply to | #1715698 |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/parisc/wax.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/parisc/wax.c b/drivers/parisc/wax.c
index da9d5ad..e2d5238 100644
--- a/drivers/parisc/wax.c
+++ b/drivers/parisc/wax.c
@@ -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, }
};
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-08-19 19:50 +0200 |
| Subject | [PATCH 4/8] parisc: hppb: constify parisc_device_id |
| Message-ID | <ugg2K-4fr-27@gated-at.bofh.it> |
| In reply to | #1715698 |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/parisc/hppb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/parisc/hppb.c b/drivers/parisc/hppb.c
index 898208e..261f826 100644
--- a/drivers/parisc/hppb.c
+++ b/drivers/parisc/hppb.c
@@ -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 */
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Helge Deller <deller@gmx.de> |
|---|---|
| Date | 2017-08-21 22:50 +0200 |
| Message-ID | <uh1O2-GL-1@gated-at.bofh.it> |
| In reply to | #1715698 |
Hi Arvind, On 19.08.2017 19:42, Arvind Yadav wrote: > 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. 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 > 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(-) >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web