2017-08-19 10:34:32

by Bhumika Goyal

[permalink] [raw]
Subject: [PATCH 0/4] drivers: make i2c_adapter const

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


2017-08-19 10:34:42

by Bhumika Goyal

[permalink] [raw]
Subject: [PATCH 1/4] i2c: busses: make i2c_adapter const

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

Signed-off-by: Bhumika Goyal <[email protected]>
---
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

2017-08-19 10:34:52

by Bhumika Goyal

[permalink] [raw]
Subject: [PATCH 2/4] [media] media: pci: make i2c_adapter const

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

Signed-off-by: Bhumika Goyal <[email protected]>
---
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

2017-08-19 10:35:00

by Bhumika Goyal

[permalink] [raw]
Subject: [PATCH 3/4] [media] radio-usb-si4713: make i2c_adapter const

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

Signed-off-by: Bhumika Goyal <[email protected]>
---
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

2017-08-19 10:35:10

by Bhumika Goyal

[permalink] [raw]
Subject: [PATCH 4/4] [media] usb: make i2c_adapter const

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

Signed-off-by: Bhumika Goyal <[email protected]>
---
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

2017-08-19 20:21:19

by Mike Isely

[permalink] [raw]
Subject: Re: [PATCH 4/4] [media] usb: make i2c_adapter const


Acked-by: Mike Isely <[email protected]>

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 <[email protected]>
> ---
> 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

2017-08-22 16:39:25

by David Daney

[permalink] [raw]
Subject: Re: [PATCH 1/4] i2c: busses: make i2c_adapter const

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 <[email protected]>



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

Acked-by: David Daney <[email protected]>

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,
>

2017-08-29 20:29:22

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 1/4] i2c: busses: make i2c_adapter const

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 <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (236.00 B)
signature.asc (833.00 B)
Download all attachments

2017-08-29 20:30:09

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 2/4] [media] media: pci: make i2c_adapter const

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 <[email protected]>

Acked-by: Wolfram Sang <[email protected]>


Attachments:
(No filename) (249.00 B)
signature.asc (833.00 B)
Download all attachments

2017-08-29 20:30:16

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 3/4] [media] radio-usb-si4713: make i2c_adapter const

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 <[email protected]>

Acked-by: Wolfram Sang <[email protected]>


Attachments:
(No filename) (245.00 B)
signature.asc (833.00 B)
Download all attachments

2017-08-29 20:30:24

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 4/4] [media] usb: make i2c_adapter const

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 <[email protected]>

Acked-by: Wolfram Sang <[email protected]>


Attachments:
(No filename) (249.00 B)
signature.asc (833.00 B)
Download all attachments