mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/8] constify parisc parisc_device_id
@ 2017-08-19 17:42 Arvind Yadav
  2017-08-19 17:42 ` [PATCH 1/8] parisc: asp: constify parisc_device_id Arvind Yadav
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-19 17:42 UTC (permalink / raw)
  To: jejb, deller; +Cc: linux-kernel, linux-parisc

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/8] parisc: asp: constify parisc_device_id
  2017-08-19 17:42 [PATCH 0/8] constify parisc parisc_device_id Arvind Yadav
@ 2017-08-19 17:42 ` Arvind Yadav
  2017-08-19 17:42 ` [PATCH 2/8] parisc: ccio: " Arvind Yadav
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-19 17:42 UTC (permalink / raw)
  To: jejb, deller; +Cc: linux-kernel, linux-parisc

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/8] parisc: ccio: constify parisc_device_id
  2017-08-19 17:42 [PATCH 0/8] constify parisc parisc_device_id Arvind Yadav
  2017-08-19 17:42 ` [PATCH 1/8] parisc: asp: constify parisc_device_id Arvind Yadav
@ 2017-08-19 17:42 ` Arvind Yadav
  2017-08-19 17:42 ` [PATCH 3/8] parisc: dino: " Arvind Yadav
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-19 17:42 UTC (permalink / raw)
  To: jejb, deller; +Cc: linux-kernel, linux-parisc

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 3/8] parisc: dino: constify parisc_device_id
  2017-08-19 17:42 [PATCH 0/8] constify parisc parisc_device_id Arvind Yadav
  2017-08-19 17:42 ` [PATCH 1/8] parisc: asp: constify parisc_device_id Arvind Yadav
  2017-08-19 17:42 ` [PATCH 2/8] parisc: ccio: " Arvind Yadav
@ 2017-08-19 17:42 ` Arvind Yadav
  2017-08-19 17:42 ` [PATCH 4/8] parisc: hppb: " Arvind Yadav
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-19 17:42 UTC (permalink / raw)
  To: jejb, deller; +Cc: linux-kernel, linux-parisc

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 4/8] parisc: hppb: constify parisc_device_id
  2017-08-19 17:42 [PATCH 0/8] constify parisc parisc_device_id Arvind Yadav
                   ` (2 preceding siblings ...)
  2017-08-19 17:42 ` [PATCH 3/8] parisc: dino: " Arvind Yadav
@ 2017-08-19 17:42 ` Arvind Yadav
  2017-08-19 17:42 ` [PATCH 5/8] parisc: lasi: " Arvind Yadav
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-19 17:42 UTC (permalink / raw)
  To: jejb, deller; +Cc: linux-kernel, linux-parisc

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 5/8] parisc: lasi: constify parisc_device_id
  2017-08-19 17:42 [PATCH 0/8] constify parisc parisc_device_id Arvind Yadav
                   ` (3 preceding siblings ...)
  2017-08-19 17:42 ` [PATCH 4/8] parisc: hppb: " Arvind Yadav
@ 2017-08-19 17:42 ` Arvind Yadav
  2017-08-19 17:42 ` [PATCH 6/8] parisc: lba_pci: " Arvind Yadav
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-19 17:42 UTC (permalink / raw)
  To: jejb, deller; +Cc: linux-kernel, linux-parisc

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 6/8] parisc: lba_pci: constify parisc_device_id
  2017-08-19 17:42 [PATCH 0/8] constify parisc parisc_device_id Arvind Yadav
                   ` (4 preceding siblings ...)
  2017-08-19 17:42 ` [PATCH 5/8] parisc: lasi: " Arvind Yadav
@ 2017-08-19 17:42 ` Arvind Yadav
  2017-08-19 17:42 ` [PATCH 7/8] parisc: sba_iommu: " Arvind Yadav
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-19 17:42 UTC (permalink / raw)
  To: jejb, deller; +Cc: linux-kernel, linux-parisc

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 7/8] parisc: sba_iommu: constify parisc_device_id
  2017-08-19 17:42 [PATCH 0/8] constify parisc parisc_device_id Arvind Yadav
                   ` (5 preceding siblings ...)
  2017-08-19 17:42 ` [PATCH 6/8] parisc: lba_pci: " Arvind Yadav
@ 2017-08-19 17:42 ` Arvind Yadav
  2017-08-19 17:42 ` [PATCH 8/8] parisc: wax: " Arvind Yadav
  2017-08-21 20:42 ` [PATCH 0/8] constify parisc parisc_device_id Helge Deller
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-19 17:42 UTC (permalink / raw)
  To: jejb, deller; +Cc: linux-kernel, linux-parisc

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 8/8] parisc: wax: constify parisc_device_id
  2017-08-19 17:42 [PATCH 0/8] constify parisc parisc_device_id Arvind Yadav
                   ` (6 preceding siblings ...)
  2017-08-19 17:42 ` [PATCH 7/8] parisc: sba_iommu: " Arvind Yadav
@ 2017-08-19 17:42 ` Arvind Yadav
  2017-08-21 20:42 ` [PATCH 0/8] constify parisc parisc_device_id Helge Deller
  8 siblings, 0 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-08-19 17:42 UTC (permalink / raw)
  To: jejb, deller; +Cc: linux-kernel, linux-parisc

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/8] constify parisc parisc_device_id
  2017-08-19 17:42 [PATCH 0/8] constify parisc parisc_device_id Arvind Yadav
                   ` (7 preceding siblings ...)
  2017-08-19 17:42 ` [PATCH 8/8] parisc: wax: " Arvind Yadav
@ 2017-08-21 20:42 ` Helge Deller
  8 siblings, 0 replies; 10+ messages in thread
From: Helge Deller @ 2017-08-21 20:42 UTC (permalink / raw)
  To: Arvind Yadav, jejb; +Cc: linux-kernel, linux-parisc

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(-)
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-08-21 20:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-19 17:42 [PATCH 0/8] constify parisc parisc_device_id Arvind Yadav
2017-08-19 17:42 ` [PATCH 1/8] parisc: asp: constify parisc_device_id Arvind Yadav
2017-08-19 17:42 ` [PATCH 2/8] parisc: ccio: " Arvind Yadav
2017-08-19 17:42 ` [PATCH 3/8] parisc: dino: " Arvind Yadav
2017-08-19 17:42 ` [PATCH 4/8] parisc: hppb: " Arvind Yadav
2017-08-19 17:42 ` [PATCH 5/8] parisc: lasi: " Arvind Yadav
2017-08-19 17:42 ` [PATCH 6/8] parisc: lba_pci: " Arvind Yadav
2017-08-19 17:42 ` [PATCH 7/8] parisc: sba_iommu: " Arvind Yadav
2017-08-19 17:42 ` [PATCH 8/8] parisc: wax: " Arvind Yadav
2017-08-21 20:42 ` [PATCH 0/8] constify parisc parisc_device_id Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome