linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] drivers: make i2c_adapter const
@ 2017-08-19 10:34 Bhumika Goyal
  2017-08-19 10:34 ` [PATCH 1/4] i2c: busses: " Bhumika Goyal
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Bhumika Goyal @ 2017-08-19 10:34 UTC (permalink / raw)
  To: julia.lawall, wsa, jacmet, jglauber, david.daney, hans.verkuil,
	mchehab, awalls, serjk, aospan, isely, ezequiel, linux-i2c,
	linux-kernel, linux-media
  Cc: Bhumika Goyal

Make i2c_adapter const. Done using Coccinelle.

Bhumika Goyal (4):
  i2c: busses: make i2c_adapter const
  [media] media: pci: make i2c_adapter const
  [media] radio-usb-si4713: make i2c_adapter const
  [media] usb: make i2c_adapter const

 drivers/i2c/busses/i2c-kempld.c                   | 2 +-
 drivers/i2c/busses/i2c-ocores.c                   | 2 +-
 drivers/i2c/busses/i2c-octeon-platdrv.c           | 2 +-
 drivers/i2c/busses/i2c-thunderx-pcidrv.c          | 2 +-
 drivers/i2c/busses/i2c-xiic.c                     | 2 +-
 drivers/media/pci/cobalt/cobalt-i2c.c             | 2 +-
 drivers/media/pci/cx18/cx18-i2c.c                 | 2 +-
 drivers/media/pci/cx23885/cx23885-i2c.c           | 2 +-
 drivers/media/pci/cx25821/cx25821-i2c.c           | 2 +-
 drivers/media/pci/ivtv/ivtv-i2c.c                 | 4 ++--
 drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c | 2 +-
 drivers/media/pci/saa7134/saa7134-i2c.c           | 2 +-
 drivers/media/pci/saa7164/saa7164-i2c.c           | 2 +-
 drivers/media/radio/si4713/radio-usb-si4713.c     | 2 +-
 drivers/media/usb/au0828/au0828-i2c.c             | 2 +-
 drivers/media/usb/cx231xx/cx231xx-i2c.c           | 2 +-
 drivers/media/usb/em28xx/em28xx-i2c.c             | 2 +-
 drivers/media/usb/hdpvr/hdpvr-i2c.c               | 2 +-
 drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c      | 2 +-
 drivers/media/usb/stk1160/stk1160-i2c.c           | 2 +-
 drivers/media/usb/usbvision/usbvision-i2c.c       | 4 ++--
 21 files changed, 23 insertions(+), 23 deletions(-)

-- 
1.9.1

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

* [PATCH 1/4] i2c: busses: make i2c_adapter const
  2017-08-19 10:34 [PATCH 0/4] drivers: make i2c_adapter const Bhumika Goyal
@ 2017-08-19 10:34 ` Bhumika Goyal
  2017-08-22 16:39   ` David Daney
  2017-08-29 20:29   ` Wolfram Sang
  2017-08-19 10:34 ` [PATCH 2/4] [media] media: pci: " Bhumika Goyal
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 11+ messages in thread
From: Bhumika Goyal @ 2017-08-19 10:34 UTC (permalink / raw)
  To: julia.lawall, wsa, jacmet, jglauber, david.daney, hans.verkuil,
	mchehab, awalls, serjk, aospan, isely, ezequiel, linux-i2c,
	linux-kernel, linux-media
  Cc: Bhumika Goyal

Make these const as they are only used in a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/i2c/busses/i2c-kempld.c          | 2 +-
 drivers/i2c/busses/i2c-ocores.c          | 2 +-
 drivers/i2c/busses/i2c-octeon-platdrv.c  | 2 +-
 drivers/i2c/busses/i2c-thunderx-pcidrv.c | 2 +-
 drivers/i2c/busses/i2c-xiic.c            | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-kempld.c b/drivers/i2c/busses/i2c-kempld.c
index 25993d2..e879190 100644
--- a/drivers/i2c/busses/i2c-kempld.c
+++ b/drivers/i2c/busses/i2c-kempld.c
@@ -289,7 +289,7 @@ static u32 kempld_i2c_func(struct i2c_adapter *adap)
 	.functionality	= kempld_i2c_func,
 };
 
-static struct i2c_adapter kempld_i2c_adapter = {
+static const struct i2c_adapter kempld_i2c_adapter = {
 	.owner		= THIS_MODULE,
 	.name		= "i2c-kempld",
 	.class		= I2C_CLASS_HWMON | I2C_CLASS_SPD,
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index 34f1889..8c42ca7 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -276,7 +276,7 @@ static u32 ocores_func(struct i2c_adapter *adap)
 	.functionality = ocores_func,
 };
 
-static struct i2c_adapter ocores_adapter = {
+static const struct i2c_adapter ocores_adapter = {
 	.owner = THIS_MODULE,
 	.name = "i2c-ocores",
 	.class = I2C_CLASS_DEPRECATED,
diff --git a/drivers/i2c/busses/i2c-octeon-platdrv.c b/drivers/i2c/busses/i2c-octeon-platdrv.c
index 917524c..64bda83 100644
--- a/drivers/i2c/busses/i2c-octeon-platdrv.c
+++ b/drivers/i2c/busses/i2c-octeon-platdrv.c
@@ -126,7 +126,7 @@ static u32 octeon_i2c_functionality(struct i2c_adapter *adap)
 	.functionality = octeon_i2c_functionality,
 };
 
-static struct i2c_adapter octeon_i2c_ops = {
+static const struct i2c_adapter octeon_i2c_ops = {
 	.owner = THIS_MODULE,
 	.name = "OCTEON adapter",
 	.algo = &octeon_i2c_algo,
diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
index ea35a895..df0976f 100644
--- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c
+++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
@@ -75,7 +75,7 @@ static u32 thunderx_i2c_functionality(struct i2c_adapter *adap)
 	.functionality = thunderx_i2c_functionality,
 };
 
-static struct i2c_adapter thunderx_i2c_ops = {
+static const struct i2c_adapter thunderx_i2c_ops = {
 	.owner	= THIS_MODULE,
 	.name	= "ThunderX adapter",
 	.algo	= &thunderx_i2c_algo,
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 34b27bf..ae6ed25 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -721,7 +721,7 @@ static u32 xiic_func(struct i2c_adapter *adap)
 	.functionality = xiic_func,
 };
 
-static struct i2c_adapter xiic_adapter = {
+static const struct i2c_adapter xiic_adapter = {
 	.owner = THIS_MODULE,
 	.name = DRIVER_NAME,
 	.class = I2C_CLASS_DEPRECATED,
-- 
1.9.1

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

* [PATCH 2/4] [media] media: pci: make i2c_adapter const
  2017-08-19 10:34 [PATCH 0/4] drivers: make i2c_adapter const Bhumika Goyal
  2017-08-19 10:34 ` [PATCH 1/4] i2c: busses: " Bhumika Goyal
@ 2017-08-19 10:34 ` Bhumika Goyal
  2017-08-29 20:30   ` Wolfram Sang
  2017-08-19 10:34 ` [PATCH 3/4] [media] radio-usb-si4713: " Bhumika Goyal
  2017-08-19 10:34 ` [PATCH 4/4] [media] usb: " Bhumika Goyal
  3 siblings, 1 reply; 11+ messages in thread
From: Bhumika Goyal @ 2017-08-19 10:34 UTC (permalink / raw)
  To: julia.lawall, wsa, jacmet, jglauber, david.daney, hans.verkuil,
	mchehab, awalls, serjk, aospan, isely, ezequiel, linux-i2c,
	linux-kernel, linux-media
  Cc: Bhumika Goyal

Make these const as they are only used in a copy operation.
Done using Coccinelle

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/media/pci/cobalt/cobalt-i2c.c             | 2 +-
 drivers/media/pci/cx18/cx18-i2c.c                 | 2 +-
 drivers/media/pci/cx23885/cx23885-i2c.c           | 2 +-
 drivers/media/pci/cx25821/cx25821-i2c.c           | 2 +-
 drivers/media/pci/ivtv/ivtv-i2c.c                 | 4 ++--
 drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c | 2 +-
 drivers/media/pci/saa7134/saa7134-i2c.c           | 2 +-
 drivers/media/pci/saa7164/saa7164-i2c.c           | 2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/media/pci/cobalt/cobalt-i2c.c b/drivers/media/pci/cobalt/cobalt-i2c.c
index ad16b89..1a5c556 100644
--- a/drivers/media/pci/cobalt/cobalt-i2c.c
+++ b/drivers/media/pci/cobalt/cobalt-i2c.c
@@ -301,7 +301,7 @@ static u32 cobalt_func(struct i2c_adapter *adap)
 }
 
 /* template for i2c-bit-algo */
-static struct i2c_adapter cobalt_i2c_adap_template = {
+static const struct i2c_adapter cobalt_i2c_adap_template = {
 	.name = "cobalt i2c driver",
 	.algo = NULL,                   /* set by i2c-algo-bit */
 	.algo_data = NULL,              /* filled from template */
diff --git a/drivers/media/pci/cx18/cx18-i2c.c b/drivers/media/pci/cx18/cx18-i2c.c
index eabdd4c..2eb62b2 100644
--- a/drivers/media/pci/cx18/cx18-i2c.c
+++ b/drivers/media/pci/cx18/cx18-i2c.c
@@ -206,7 +206,7 @@ static int cx18_getsda(void *data)
 }
 
 /* template for i2c-bit-algo */
-static struct i2c_adapter cx18_i2c_adap_template = {
+static const struct i2c_adapter cx18_i2c_adap_template = {
 	.name = "cx18 i2c driver",
 	.algo = NULL,                   /* set by i2c-algo-bit */
 	.algo_data = NULL,              /* filled from template */
diff --git a/drivers/media/pci/cx23885/cx23885-i2c.c b/drivers/media/pci/cx23885/cx23885-i2c.c
index 8528032..0f21467 100644
--- a/drivers/media/pci/cx23885/cx23885-i2c.c
+++ b/drivers/media/pci/cx23885/cx23885-i2c.c
@@ -264,7 +264,7 @@ static u32 cx23885_functionality(struct i2c_adapter *adap)
 
 /* ----------------------------------------------------------------------- */
 
-static struct i2c_adapter cx23885_i2c_adap_template = {
+static const struct i2c_adapter cx23885_i2c_adap_template = {
 	.name              = "cx23885",
 	.owner             = THIS_MODULE,
 	.algo              = &cx23885_i2c_algo_template,
diff --git a/drivers/media/pci/cx25821/cx25821-i2c.c b/drivers/media/pci/cx25821/cx25821-i2c.c
index 263a1cf..000049d 100644
--- a/drivers/media/pci/cx25821/cx25821-i2c.c
+++ b/drivers/media/pci/cx25821/cx25821-i2c.c
@@ -285,7 +285,7 @@ static u32 cx25821_functionality(struct i2c_adapter *adap)
 #endif
 };
 
-static struct i2c_adapter cx25821_i2c_adap_template = {
+static const struct i2c_adapter cx25821_i2c_adap_template = {
 	.name = "cx25821",
 	.owner = THIS_MODULE,
 	.algo = &cx25821_i2c_algo_template,
diff --git a/drivers/media/pci/ivtv/ivtv-i2c.c b/drivers/media/pci/ivtv/ivtv-i2c.c
index dea80ef..1ef6c72 100644
--- a/drivers/media/pci/ivtv/ivtv-i2c.c
+++ b/drivers/media/pci/ivtv/ivtv-i2c.c
@@ -632,7 +632,7 @@ static u32 ivtv_functionality(struct i2c_adapter *adap)
 };
 
 /* template for our-bit banger */
-static struct i2c_adapter ivtv_i2c_adap_hw_template = {
+static const struct i2c_adapter ivtv_i2c_adap_hw_template = {
 	.name = "ivtv i2c driver",
 	.algo = &ivtv_algo,
 	.algo_data = NULL,			/* filled from template */
@@ -682,7 +682,7 @@ static int ivtv_getsda_old(void *data)
 }
 
 /* template for i2c-bit-algo */
-static struct i2c_adapter ivtv_i2c_adap_template = {
+static const struct i2c_adapter ivtv_i2c_adap_template = {
 	.name = "ivtv i2c driver",
 	.algo = NULL,                   /* set by i2c-algo-bit */
 	.algo_data = NULL,              /* filled from template */
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c b/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
index b49e4f9..b13e319 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
@@ -300,7 +300,7 @@ static u32 netup_i2c_func(struct i2c_adapter *adap)
 	.functionality	= netup_i2c_func,
 };
 
-static struct i2c_adapter netup_i2c_adapter = {
+static const struct i2c_adapter netup_i2c_adapter = {
 	.owner		= THIS_MODULE,
 	.name		= NETUP_UNIDVB_NAME,
 	.class		= I2C_CLASS_HWMON | I2C_CLASS_SPD,
diff --git a/drivers/media/pci/saa7134/saa7134-i2c.c b/drivers/media/pci/saa7134/saa7134-i2c.c
index 9d0e69e..8f2ed63 100644
--- a/drivers/media/pci/saa7134/saa7134-i2c.c
+++ b/drivers/media/pci/saa7134/saa7134-i2c.c
@@ -339,7 +339,7 @@ static u32 functionality(struct i2c_adapter *adap)
 	.functionality = functionality,
 };
 
-static struct i2c_adapter saa7134_adap_template = {
+static const struct i2c_adapter saa7134_adap_template = {
 	.owner         = THIS_MODULE,
 	.name          = "saa7134",
 	.algo          = &saa7134_algo,
diff --git a/drivers/media/pci/saa7164/saa7164-i2c.c b/drivers/media/pci/saa7164/saa7164-i2c.c
index 430f678..4bcde7c 100644
--- a/drivers/media/pci/saa7164/saa7164-i2c.c
+++ b/drivers/media/pci/saa7164/saa7164-i2c.c
@@ -78,7 +78,7 @@ static u32 saa7164_functionality(struct i2c_adapter *adap)
 
 /* ----------------------------------------------------------------------- */
 
-static struct i2c_adapter saa7164_i2c_adap_template = {
+static const struct i2c_adapter saa7164_i2c_adap_template = {
 	.name              = "saa7164",
 	.owner             = THIS_MODULE,
 	.algo              = &saa7164_i2c_algo_template,
-- 
1.9.1

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

* [PATCH 3/4] [media] radio-usb-si4713: make i2c_adapter const
  2017-08-19 10:34 [PATCH 0/4] drivers: make i2c_adapter const Bhumika Goyal
  2017-08-19 10:34 ` [PATCH 1/4] i2c: busses: " Bhumika Goyal
  2017-08-19 10:34 ` [PATCH 2/4] [media] media: pci: " Bhumika Goyal
@ 2017-08-19 10:34 ` Bhumika Goyal
  2017-08-29 20:30   ` Wolfram Sang
  2017-08-19 10:34 ` [PATCH 4/4] [media] usb: " Bhumika Goyal
  3 siblings, 1 reply; 11+ messages in thread
From: Bhumika Goyal @ 2017-08-19 10:34 UTC (permalink / raw)
  To: julia.lawall, wsa, jacmet, jglauber, david.daney, hans.verkuil,
	mchehab, awalls, serjk, aospan, isely, ezequiel, linux-i2c,
	linux-kernel, linux-media
  Cc: Bhumika Goyal

Make this const as it is only used in a copy operation.
Done using Coccinelle

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/media/radio/si4713/radio-usb-si4713.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c
index e5e5a16..f20aac2 100644
--- a/drivers/media/radio/si4713/radio-usb-si4713.c
+++ b/drivers/media/radio/si4713/radio-usb-si4713.c
@@ -409,7 +409,7 @@ static u32 si4713_functionality(struct i2c_adapter *adapter)
 
 /* This name value shows up in the sysfs filename associated
 		with this I2C adapter */
-static struct i2c_adapter si4713_i2c_adapter_template = {
+static const struct i2c_adapter si4713_i2c_adapter_template = {
 	.name   = "si4713-i2c",
 	.owner  = THIS_MODULE,
 	.algo   = &si4713_algo,
-- 
1.9.1

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

* [PATCH 4/4] [media] usb: make i2c_adapter const
  2017-08-19 10:34 [PATCH 0/4] drivers: make i2c_adapter const Bhumika Goyal
                   ` (2 preceding siblings ...)
  2017-08-19 10:34 ` [PATCH 3/4] [media] radio-usb-si4713: " Bhumika Goyal
@ 2017-08-19 10:34 ` Bhumika Goyal
  2017-08-19 20:16   ` isely
  2017-08-29 20:30   ` Wolfram Sang
  3 siblings, 2 replies; 11+ messages in thread
From: Bhumika Goyal @ 2017-08-19 10:34 UTC (permalink / raw)
  To: julia.lawall, wsa, jacmet, jglauber, david.daney, hans.verkuil,
	mchehab, awalls, serjk, aospan, isely, ezequiel, linux-i2c,
	linux-kernel, linux-media
  Cc: Bhumika Goyal

Make these const as they are only used in a copy operation.
Done using Coccinelle

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/media/usb/au0828/au0828-i2c.c        | 2 +-
 drivers/media/usb/cx231xx/cx231xx-i2c.c      | 2 +-
 drivers/media/usb/em28xx/em28xx-i2c.c        | 2 +-
 drivers/media/usb/hdpvr/hdpvr-i2c.c          | 2 +-
 drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 2 +-
 drivers/media/usb/stk1160/stk1160-i2c.c      | 2 +-
 drivers/media/usb/usbvision/usbvision-i2c.c  | 4 ++--
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/media/usb/au0828/au0828-i2c.c b/drivers/media/usb/au0828/au0828-i2c.c
index 42b352b..9074a98 100644
--- a/drivers/media/usb/au0828/au0828-i2c.c
+++ b/drivers/media/usb/au0828/au0828-i2c.c
@@ -336,7 +336,7 @@ static u32 au0828_functionality(struct i2c_adapter *adap)
 
 /* ----------------------------------------------------------------------- */
 
-static struct i2c_adapter au0828_i2c_adap_template = {
+static const struct i2c_adapter au0828_i2c_adap_template = {
 	.name              = KBUILD_MODNAME,
 	.owner             = THIS_MODULE,
 	.algo              = &au0828_i2c_algo_template,
diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 8ce6b81..23648da 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -459,7 +459,7 @@ static u32 functionality(struct i2c_adapter *adap)
 	.functionality = functionality,
 };
 
-static struct i2c_adapter cx231xx_adap_template = {
+static const struct i2c_adapter cx231xx_adap_template = {
 	.owner = THIS_MODULE,
 	.name = "cx231xx",
 	.algo = &cx231xx_algo,
diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c
index 60b195c..66c5012 100644
--- a/drivers/media/usb/em28xx/em28xx-i2c.c
+++ b/drivers/media/usb/em28xx/em28xx-i2c.c
@@ -876,7 +876,7 @@ static u32 functionality(struct i2c_adapter *i2c_adap)
 	.functionality = functionality,
 };
 
-static struct i2c_adapter em28xx_adap_template = {
+static const struct i2c_adapter em28xx_adap_template = {
 	.owner = THIS_MODULE,
 	.name = "em28xx",
 	.algo = &em28xx_algo,
diff --git a/drivers/media/usb/hdpvr/hdpvr-i2c.c b/drivers/media/usb/hdpvr/hdpvr-i2c.c
index fcab550..7329310 100644
--- a/drivers/media/usb/hdpvr/hdpvr-i2c.c
+++ b/drivers/media/usb/hdpvr/hdpvr-i2c.c
@@ -184,7 +184,7 @@ static u32 hdpvr_functionality(struct i2c_adapter *adapter)
 	.functionality = hdpvr_functionality,
 };
 
-static struct i2c_adapter hdpvr_i2c_adapter_template = {
+static const struct i2c_adapter hdpvr_i2c_adapter_template = {
 	.name   = "Hauppage HD PVR I2C",
 	.owner  = THIS_MODULE,
 	.algo   = &hdpvr_algo,
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
index 20a52b7..3618ace 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
@@ -519,7 +519,7 @@ static u32 pvr2_i2c_functionality(struct i2c_adapter *adap)
 	.functionality = pvr2_i2c_functionality,
 };
 
-static struct i2c_adapter pvr2_i2c_adap_template = {
+static const struct i2c_adapter pvr2_i2c_adap_template = {
 	.owner         = THIS_MODULE,
 	.class	       = 0,
 };
diff --git a/drivers/media/usb/stk1160/stk1160-i2c.c b/drivers/media/usb/stk1160/stk1160-i2c.c
index 3f2517b..2c70173 100644
--- a/drivers/media/usb/stk1160/stk1160-i2c.c
+++ b/drivers/media/usb/stk1160/stk1160-i2c.c
@@ -240,7 +240,7 @@ static u32 functionality(struct i2c_adapter *adap)
 	.functionality = functionality,
 };
 
-static struct i2c_adapter adap_template = {
+static const struct i2c_adapter adap_template = {
 	.owner = THIS_MODULE,
 	.name = "stk1160",
 	.algo = &algo,
diff --git a/drivers/media/usb/usbvision/usbvision-i2c.c b/drivers/media/usb/usbvision/usbvision-i2c.c
index 68acafb..837bd4d 100644
--- a/drivers/media/usb/usbvision/usbvision-i2c.c
+++ b/drivers/media/usb/usbvision/usbvision-i2c.c
@@ -173,7 +173,7 @@ static u32 functionality(struct i2c_adapter *adap)
 /* ----------------------------------------------------------------------- */
 /* usbvision specific I2C functions                                        */
 /* ----------------------------------------------------------------------- */
-static struct i2c_adapter i2c_adap_template;
+static const struct i2c_adapter i2c_adap_template;
 
 int usbvision_i2c_register(struct usb_usbvision *usbvision)
 {
@@ -441,7 +441,7 @@ static int usbvision_i2c_read(struct usb_usbvision *usbvision, unsigned char add
 	return rdcount;
 }
 
-static struct i2c_adapter i2c_adap_template = {
+static const struct i2c_adapter i2c_adap_template = {
 	.owner = THIS_MODULE,
 	.name              = "usbvision",
 };
-- 
1.9.1

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

* Re: [PATCH 4/4] [media] usb: make i2c_adapter const
  2017-08-19 10:34 ` [PATCH 4/4] [media] usb: " Bhumika Goyal
@ 2017-08-19 20:16   ` isely
  2017-08-29 20:30   ` Wolfram Sang
  1 sibling, 0 replies; 11+ messages in thread
From: isely @ 2017-08-19 20:16 UTC (permalink / raw)
  To: Bhumika Goyal
  Cc: julia.lawall, wsa, jacmet, jglauber, david.daney, hans.verkuil,
	mchehab, awalls, serjk, aospan, ezequiel, linux-i2c,
	Linux Kernel Mailing List, linux-media, Mike Isely at pobox


Acked-by: Mike Isely <isely@pobox.com>

On Sat, 19 Aug 2017, Bhumika Goyal wrote:

> Make these const as they are only used in a copy operation.
> Done using Coccinelle
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
>  drivers/media/usb/au0828/au0828-i2c.c        | 2 +-
>  drivers/media/usb/cx231xx/cx231xx-i2c.c      | 2 +-
>  drivers/media/usb/em28xx/em28xx-i2c.c        | 2 +-
>  drivers/media/usb/hdpvr/hdpvr-i2c.c          | 2 +-
>  drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 2 +-
>  drivers/media/usb/stk1160/stk1160-i2c.c      | 2 +-
>  drivers/media/usb/usbvision/usbvision-i2c.c  | 4 ++--
>  7 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/usb/au0828/au0828-i2c.c b/drivers/media/usb/au0828/au0828-i2c.c
> index 42b352b..9074a98 100644
> --- a/drivers/media/usb/au0828/au0828-i2c.c
> +++ b/drivers/media/usb/au0828/au0828-i2c.c
> @@ -336,7 +336,7 @@ static u32 au0828_functionality(struct i2c_adapter *adap)
>  
>  /* ----------------------------------------------------------------------- */
>  
> -static struct i2c_adapter au0828_i2c_adap_template = {
> +static const struct i2c_adapter au0828_i2c_adap_template = {
>  	.name              = KBUILD_MODNAME,
>  	.owner             = THIS_MODULE,
>  	.algo              = &au0828_i2c_algo_template,
> diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c
> index 8ce6b81..23648da 100644
> --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
> +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
> @@ -459,7 +459,7 @@ static u32 functionality(struct i2c_adapter *adap)
>  	.functionality = functionality,
>  };
>  
> -static struct i2c_adapter cx231xx_adap_template = {
> +static const struct i2c_adapter cx231xx_adap_template = {
>  	.owner = THIS_MODULE,
>  	.name = "cx231xx",
>  	.algo = &cx231xx_algo,
> diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c
> index 60b195c..66c5012 100644
> --- a/drivers/media/usb/em28xx/em28xx-i2c.c
> +++ b/drivers/media/usb/em28xx/em28xx-i2c.c
> @@ -876,7 +876,7 @@ static u32 functionality(struct i2c_adapter *i2c_adap)
>  	.functionality = functionality,
>  };
>  
> -static struct i2c_adapter em28xx_adap_template = {
> +static const struct i2c_adapter em28xx_adap_template = {
>  	.owner = THIS_MODULE,
>  	.name = "em28xx",
>  	.algo = &em28xx_algo,
> diff --git a/drivers/media/usb/hdpvr/hdpvr-i2c.c b/drivers/media/usb/hdpvr/hdpvr-i2c.c
> index fcab550..7329310 100644
> --- a/drivers/media/usb/hdpvr/hdpvr-i2c.c
> +++ b/drivers/media/usb/hdpvr/hdpvr-i2c.c
> @@ -184,7 +184,7 @@ static u32 hdpvr_functionality(struct i2c_adapter *adapter)
>  	.functionality = hdpvr_functionality,
>  };
>  
> -static struct i2c_adapter hdpvr_i2c_adapter_template = {
> +static const struct i2c_adapter hdpvr_i2c_adapter_template = {
>  	.name   = "Hauppage HD PVR I2C",
>  	.owner  = THIS_MODULE,
>  	.algo   = &hdpvr_algo,
> diff --git a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
> index 20a52b7..3618ace 100644
> --- a/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
> +++ b/drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
> @@ -519,7 +519,7 @@ static u32 pvr2_i2c_functionality(struct i2c_adapter *adap)
>  	.functionality = pvr2_i2c_functionality,
>  };
>  
> -static struct i2c_adapter pvr2_i2c_adap_template = {
> +static const struct i2c_adapter pvr2_i2c_adap_template = {
>  	.owner         = THIS_MODULE,
>  	.class	       = 0,
>  };
> diff --git a/drivers/media/usb/stk1160/stk1160-i2c.c b/drivers/media/usb/stk1160/stk1160-i2c.c
> index 3f2517b..2c70173 100644
> --- a/drivers/media/usb/stk1160/stk1160-i2c.c
> +++ b/drivers/media/usb/stk1160/stk1160-i2c.c
> @@ -240,7 +240,7 @@ static u32 functionality(struct i2c_adapter *adap)
>  	.functionality = functionality,
>  };
>  
> -static struct i2c_adapter adap_template = {
> +static const struct i2c_adapter adap_template = {
>  	.owner = THIS_MODULE,
>  	.name = "stk1160",
>  	.algo = &algo,
> diff --git a/drivers/media/usb/usbvision/usbvision-i2c.c b/drivers/media/usb/usbvision/usbvision-i2c.c
> index 68acafb..837bd4d 100644
> --- a/drivers/media/usb/usbvision/usbvision-i2c.c
> +++ b/drivers/media/usb/usbvision/usbvision-i2c.c
> @@ -173,7 +173,7 @@ static u32 functionality(struct i2c_adapter *adap)
>  /* ----------------------------------------------------------------------- */
>  /* usbvision specific I2C functions                                        */
>  /* ----------------------------------------------------------------------- */
> -static struct i2c_adapter i2c_adap_template;
> +static const struct i2c_adapter i2c_adap_template;
>  
>  int usbvision_i2c_register(struct usb_usbvision *usbvision)
>  {
> @@ -441,7 +441,7 @@ static int usbvision_i2c_read(struct usb_usbvision *usbvision, unsigned char add
>  	return rdcount;
>  }
>  
> -static struct i2c_adapter i2c_adap_template = {
> +static const struct i2c_adapter i2c_adap_template = {
>  	.owner = THIS_MODULE,
>  	.name              = "usbvision",
>  };
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8

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

* Re: [PATCH 1/4] i2c: busses: make i2c_adapter const
  2017-08-19 10:34 ` [PATCH 1/4] i2c: busses: " Bhumika Goyal
@ 2017-08-22 16:39   ` David Daney
  2017-08-29 20:29   ` Wolfram Sang
  1 sibling, 0 replies; 11+ messages in thread
From: David Daney @ 2017-08-22 16:39 UTC (permalink / raw)
  To: Bhumika Goyal, julia.lawall, wsa, jacmet, jglauber, david.daney,
	hans.verkuil, mchehab, awalls, serjk, aospan, isely, ezequiel,
	linux-i2c, linux-kernel, linux-media

On 08/19/2017 03:34 AM, Bhumika Goyal wrote:
> Make these const as they are only used in a copy operation.
> Done using Coccinelle.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>



i2c-octeon-platdrv.c and i2c-thunderx-pcidrv.c changes:

Acked-by: David Daney <david.daney@cavium.com>

Thanks.

> ---
>   drivers/i2c/busses/i2c-kempld.c          | 2 +-
>   drivers/i2c/busses/i2c-ocores.c          | 2 +-
>   drivers/i2c/busses/i2c-octeon-platdrv.c  | 2 +-
>   drivers/i2c/busses/i2c-thunderx-pcidrv.c | 2 +-
>   drivers/i2c/busses/i2c-xiic.c            | 2 +-
>   5 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-kempld.c b/drivers/i2c/busses/i2c-kempld.c
> index 25993d2..e879190 100644
> --- a/drivers/i2c/busses/i2c-kempld.c
> +++ b/drivers/i2c/busses/i2c-kempld.c
> @@ -289,7 +289,7 @@ static u32 kempld_i2c_func(struct i2c_adapter *adap)
>   	.functionality	= kempld_i2c_func,
>   };
>   
> -static struct i2c_adapter kempld_i2c_adapter = {
> +static const struct i2c_adapter kempld_i2c_adapter = {
>   	.owner		= THIS_MODULE,
>   	.name		= "i2c-kempld",
>   	.class		= I2C_CLASS_HWMON | I2C_CLASS_SPD,
> diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
> index 34f1889..8c42ca7 100644
> --- a/drivers/i2c/busses/i2c-ocores.c
> +++ b/drivers/i2c/busses/i2c-ocores.c
> @@ -276,7 +276,7 @@ static u32 ocores_func(struct i2c_adapter *adap)
>   	.functionality = ocores_func,
>   };
>   
> -static struct i2c_adapter ocores_adapter = {
> +static const struct i2c_adapter ocores_adapter = {
>   	.owner = THIS_MODULE,
>   	.name = "i2c-ocores",
>   	.class = I2C_CLASS_DEPRECATED,
> diff --git a/drivers/i2c/busses/i2c-octeon-platdrv.c b/drivers/i2c/busses/i2c-octeon-platdrv.c
> index 917524c..64bda83 100644
> --- a/drivers/i2c/busses/i2c-octeon-platdrv.c
> +++ b/drivers/i2c/busses/i2c-octeon-platdrv.c
> @@ -126,7 +126,7 @@ static u32 octeon_i2c_functionality(struct i2c_adapter *adap)
>   	.functionality = octeon_i2c_functionality,
>   };
>   
> -static struct i2c_adapter octeon_i2c_ops = {
> +static const struct i2c_adapter octeon_i2c_ops = {
>   	.owner = THIS_MODULE,
>   	.name = "OCTEON adapter",
>   	.algo = &octeon_i2c_algo,
> diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
> index ea35a895..df0976f 100644
> --- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c
> +++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
> @@ -75,7 +75,7 @@ static u32 thunderx_i2c_functionality(struct i2c_adapter *adap)
>   	.functionality = thunderx_i2c_functionality,
>   };
>   
> -static struct i2c_adapter thunderx_i2c_ops = {
> +static const struct i2c_adapter thunderx_i2c_ops = {
>   	.owner	= THIS_MODULE,
>   	.name	= "ThunderX adapter",
>   	.algo	= &thunderx_i2c_algo,
> diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
> index 34b27bf..ae6ed25 100644
> --- a/drivers/i2c/busses/i2c-xiic.c
> +++ b/drivers/i2c/busses/i2c-xiic.c
> @@ -721,7 +721,7 @@ static u32 xiic_func(struct i2c_adapter *adap)
>   	.functionality = xiic_func,
>   };
>   
> -static struct i2c_adapter xiic_adapter = {
> +static const struct i2c_adapter xiic_adapter = {
>   	.owner = THIS_MODULE,
>   	.name = DRIVER_NAME,
>   	.class = I2C_CLASS_DEPRECATED,
> 

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

* Re: [PATCH 1/4] i2c: busses: make i2c_adapter const
  2017-08-19 10:34 ` [PATCH 1/4] i2c: busses: " Bhumika Goyal
  2017-08-22 16:39   ` David Daney
@ 2017-08-29 20:29   ` Wolfram Sang
  1 sibling, 0 replies; 11+ messages in thread
From: Wolfram Sang @ 2017-08-29 20:29 UTC (permalink / raw)
  To: Bhumika Goyal
  Cc: julia.lawall, jacmet, jglauber, david.daney, hans.verkuil,
	mchehab, awalls, serjk, aospan, isely, ezequiel, linux-i2c,
	linux-kernel, linux-media

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

On Sat, Aug 19, 2017 at 04:04:12PM +0530, Bhumika Goyal wrote:
> Make these const as they are only used in a copy operation.
> Done using Coccinelle.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 2/4] [media] media: pci: make i2c_adapter const
  2017-08-19 10:34 ` [PATCH 2/4] [media] media: pci: " Bhumika Goyal
@ 2017-08-29 20:30   ` Wolfram Sang
  0 siblings, 0 replies; 11+ messages in thread
From: Wolfram Sang @ 2017-08-29 20:30 UTC (permalink / raw)
  To: Bhumika Goyal
  Cc: julia.lawall, jacmet, jglauber, david.daney, hans.verkuil,
	mchehab, awalls, serjk, aospan, isely, ezequiel, linux-i2c,
	linux-kernel, linux-media

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

On Sat, Aug 19, 2017 at 04:04:13PM +0530, Bhumika Goyal wrote:
> Make these const as they are only used in a copy operation.
> Done using Coccinelle
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Acked-by: Wolfram Sang <wsa@the-dreams.de>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 3/4] [media] radio-usb-si4713: make i2c_adapter const
  2017-08-19 10:34 ` [PATCH 3/4] [media] radio-usb-si4713: " Bhumika Goyal
@ 2017-08-29 20:30   ` Wolfram Sang
  0 siblings, 0 replies; 11+ messages in thread
From: Wolfram Sang @ 2017-08-29 20:30 UTC (permalink / raw)
  To: Bhumika Goyal
  Cc: julia.lawall, jacmet, jglauber, david.daney, hans.verkuil,
	mchehab, awalls, serjk, aospan, isely, ezequiel, linux-i2c,
	linux-kernel, linux-media

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

On Sat, Aug 19, 2017 at 04:04:14PM +0530, Bhumika Goyal wrote:
> Make this const as it is only used in a copy operation.
> Done using Coccinelle
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Acked-by: Wolfram Sang <wsa@the-dreams.de>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 4/4] [media] usb: make i2c_adapter const
  2017-08-19 10:34 ` [PATCH 4/4] [media] usb: " Bhumika Goyal
  2017-08-19 20:16   ` isely
@ 2017-08-29 20:30   ` Wolfram Sang
  1 sibling, 0 replies; 11+ messages in thread
From: Wolfram Sang @ 2017-08-29 20:30 UTC (permalink / raw)
  To: Bhumika Goyal
  Cc: julia.lawall, jacmet, jglauber, david.daney, hans.verkuil,
	mchehab, awalls, serjk, aospan, isely, ezequiel, linux-i2c,
	linux-kernel, linux-media

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

On Sat, Aug 19, 2017 at 04:04:15PM +0530, Bhumika Goyal wrote:
> Make these const as they are only used in a copy operation.
> Done using Coccinelle
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Acked-by: Wolfram Sang <wsa@the-dreams.de>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

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

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-19 10:34 [PATCH 0/4] drivers: make i2c_adapter const Bhumika Goyal
2017-08-19 10:34 ` [PATCH 1/4] i2c: busses: " Bhumika Goyal
2017-08-22 16:39   ` David Daney
2017-08-29 20:29   ` Wolfram Sang
2017-08-19 10:34 ` [PATCH 2/4] [media] media: pci: " Bhumika Goyal
2017-08-29 20:30   ` Wolfram Sang
2017-08-19 10:34 ` [PATCH 3/4] [media] radio-usb-si4713: " Bhumika Goyal
2017-08-29 20:30   ` Wolfram Sang
2017-08-19 10:34 ` [PATCH 4/4] [media] usb: " Bhumika Goyal
2017-08-19 20:16   ` isely
2017-08-29 20:30   ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).