Skip to contentSkip to conversation

constify media i2c_device_id

PATCH New Arvind Yadav 1 participant 7 messages Aug 19, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover constify media i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by <linux/i2c.h> work with const i2c_device_id. So mark the non-const structs as const.

Arvind Yadav (6):
[PATCH 1/6] [media] ad9389b: constify i2c_device_id [PATCH 2/6] [media] adv7511: constify i2c_device_id [PATCH 3/6] [media] adv7842: constify i2c_device_id [PATCH 4/6] [media] saa7127: constify i2c_device_id [PATCH 5/6] [media] tc358743: constify i2c_device_id [PATCH 6/6] [media] ths8200: constify i2c_device_id

 drivers/media/i2c/ad9389b.c  | 2 +-
 drivers/media/i2c/adv7511.c  | 2 +-
 drivers/media/i2c/adv7842.c  | 2 +-
 drivers/media/i2c/saa7127.c  | 2 +-
 drivers/media/i2c/tc358743.c | 2 +-
 drivers/media/i2c/ths8200.c  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/6 ad9389b: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by <linux/i2c.h> work with const i2c_device_id. So mark the non-const structs as const.

---
 drivers/media/i2c/ad9389b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ad9389b.c +1 -1
index 50f3541..a056d6c 100644
@@ -1208,7 +1208,7 @@ static int ad9389b_remove(struct i2c_client *client)
 
 /* ----------------------------------------------------------------------- */
 
-static struct i2c_device_id ad9389b_id[] = {
+static const struct i2c_device_id ad9389b_id[] = {
 	{ "ad9389b", 0 },
 	{ "ad9889b", 0 },
 	{ }
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/6 adv7511: constify i2c_device_id

In reply to Arvind Yadav

i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by <linux/i2c.h> work with const i2c_device_id. So mark the non-const structs as const.

---
 drivers/media/i2c/adv7511.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/adv7511.c +1 -1
index ccc4786..8fc97a8 100644
@@ -1986,7 +1986,7 @@ static int adv7511_remove(struct i2c_client *client)
 
 /* ----------------------------------------------------------------------- */
 
-static struct i2c_device_id adv7511_id[] = {
+static const struct i2c_device_id adv7511_id[] = {
 	{ "adv7511", 0 },
 	{ }
 };
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/6 adv7842: constify i2c_device_id

In reply to Arvind Yadav

i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by <linux/i2c.h> work with const i2c_device_id. So mark the non-const structs as const.

---
 drivers/media/i2c/adv7842.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/adv7842.c +1 -1
index 303effd..9b959ec 100644
@@ -3608,7 +3608,7 @@ static int adv7842_remove(struct i2c_client *client)
 
 /* ----------------------------------------------------------------------- */
 
-static struct i2c_device_id adv7842_id[] = {
+static const struct i2c_device_id adv7842_id[] = {
 	{ "adv7842", 0 },
 	{ }
 };
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/6 saa7127: constify i2c_device_id

In reply to Arvind Yadav

i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by <linux/i2c.h> work with const i2c_device_id. So mark the non-const structs as const.

---
 drivers/media/i2c/saa7127.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/saa7127.c +1 -1
index 99c3030..01784d4 100644
@@ -806,7 +806,7 @@ static int saa7127_remove(struct i2c_client *client)
 
 /* ----------------------------------------------------------------------- */
 
-static struct i2c_device_id saa7127_id[] = {
+static const struct i2c_device_id saa7127_id[] = {
 	{ "saa7127_auto", 0 },	/* auto-detection */
 	{ "saa7126", SAA7127 },
 	{ "saa7127", SAA7127 },
Signature · 1 line
2.7.4
#5 lore raw

PATCH 5/6 tc358743: constify i2c_device_id

In reply to Arvind Yadav

i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by <linux/i2c.h> work with const i2c_device_id. So mark the non-const structs as const.

---
 drivers/media/i2c/tc358743.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/tc358743.c +1 -1
index 5788af2..e6f5c36 100644
@@ -2013,7 +2013,7 @@ static int tc358743_remove(struct i2c_client *client)
 	return 0;
 }
 
-static struct i2c_device_id tc358743_id[] = {
+static const struct i2c_device_id tc358743_id[] = {
 	{"tc358743", 0},
 	{}
 };
Signature · 1 line
2.7.4
#6 lore raw

PATCH 6/6 ths8200: constify i2c_device_id

In reply to Arvind Yadav

i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by <linux/i2c.h> work with const i2c_device_id. So mark the non-const structs as const.

---
 drivers/media/i2c/ths8200.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/ths8200.c +1 -1
index 42340e3..498ad23 100644
@@ -483,7 +483,7 @@ static int ths8200_remove(struct i2c_client *client)
 	return 0;
 }
 
-static struct i2c_device_id ths8200_id[] = {
+static const struct i2c_device_id ths8200_id[] = {
 	{ "ths8200", 0 },
 	{},
 };
Signature · 1 line
2.7.4