mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] constify i2c_device_id
@ 2017-08-21 16:43 Arvind Yadav
  2017-08-21 16:43 ` [PATCH 1/4] misc: apds9802als: " Arvind Yadav
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arvind Yadav @ 2017-08-21 16:43 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel

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 (4):
  [PATCH 1/4] misc: apds9802als: constify i2c_device_id
  [PATCH 2/4] misc: hmc6352: constify i2c_device_id
  [PATCH 3/4] misc: isl29020: constify i2c_device_id
  [PATCH 4/4] staging: iio: tsl2x7x: constify i2c_device_id

 drivers/misc/apds9802als.c          | 2 +-
 drivers/misc/hmc6352.c              | 2 +-
 drivers/misc/isl29020.c             | 2 +-
 drivers/staging/iio/light/tsl2x7x.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

-- 
2.7.4

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

* [PATCH 1/4] misc: apds9802als: constify i2c_device_id
  2017-08-21 16:43 [PATCH 0/4] constify i2c_device_id Arvind Yadav
@ 2017-08-21 16:43 ` Arvind Yadav
  2017-08-21 16:43 ` [PATCH 2/4] misc: hmc6352: " Arvind Yadav
  2017-08-21 16:43 ` [PATCH 3/4] misc: isl29020: " Arvind Yadav
  2 siblings, 0 replies; 4+ messages in thread
From: Arvind Yadav @ 2017-08-21 16:43 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel

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.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/misc/apds9802als.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c
index c6cc3dc..944ac9d 100644
--- a/drivers/misc/apds9802als.c
+++ b/drivers/misc/apds9802als.c
@@ -298,7 +298,7 @@ static UNIVERSAL_DEV_PM_OPS(apds9802als_pm_ops, apds9802als_suspend,
 #define APDS9802ALS_PM_OPS NULL
 #endif	/* CONFIG_PM */
 
-static struct i2c_device_id apds9802als_id[] = {
+static const struct i2c_device_id apds9802als_id[] = {
 	{ DRIVER_NAME, 0 },
 	{ }
 };
-- 
2.7.4

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

* [PATCH 2/4] misc: hmc6352: constify i2c_device_id
  2017-08-21 16:43 [PATCH 0/4] constify i2c_device_id Arvind Yadav
  2017-08-21 16:43 ` [PATCH 1/4] misc: apds9802als: " Arvind Yadav
@ 2017-08-21 16:43 ` Arvind Yadav
  2017-08-21 16:43 ` [PATCH 3/4] misc: isl29020: " Arvind Yadav
  2 siblings, 0 replies; 4+ messages in thread
From: Arvind Yadav @ 2017-08-21 16:43 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel

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.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/misc/hmc6352.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/hmc6352.c b/drivers/misc/hmc6352.c
index 90520d7..eeb7eef 100644
--- a/drivers/misc/hmc6352.c
+++ b/drivers/misc/hmc6352.c
@@ -132,7 +132,7 @@ static int hmc6352_remove(struct i2c_client *client)
 	return 0;
 }
 
-static struct i2c_device_id hmc6352_id[] = {
+static const struct i2c_device_id hmc6352_id[] = {
 	{ "hmc6352", 0 },
 	{ }
 };
-- 
2.7.4

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

* [PATCH 3/4] misc: isl29020: constify i2c_device_id
  2017-08-21 16:43 [PATCH 0/4] constify i2c_device_id Arvind Yadav
  2017-08-21 16:43 ` [PATCH 1/4] misc: apds9802als: " Arvind Yadav
  2017-08-21 16:43 ` [PATCH 2/4] misc: hmc6352: " Arvind Yadav
@ 2017-08-21 16:43 ` Arvind Yadav
  2 siblings, 0 replies; 4+ messages in thread
From: Arvind Yadav @ 2017-08-21 16:43 UTC (permalink / raw)
  To: arnd, gregkh; +Cc: linux-kernel

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.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/misc/isl29020.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/isl29020.c b/drivers/misc/isl29020.c
index 4a9c50a..02fac5b 100644
--- a/drivers/misc/isl29020.c
+++ b/drivers/misc/isl29020.c
@@ -188,7 +188,7 @@ static int isl29020_remove(struct i2c_client *client)
 	return 0;
 }
 
-static struct i2c_device_id isl29020_id[] = {
+static const struct i2c_device_id isl29020_id[] = {
 	{ "isl29020", 0 },
 	{ }
 };
-- 
2.7.4

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-21 16:43 [PATCH 0/4] constify i2c_device_id Arvind Yadav
2017-08-21 16:43 ` [PATCH 1/4] misc: apds9802als: " Arvind Yadav
2017-08-21 16:43 ` [PATCH 2/4] misc: hmc6352: " Arvind Yadav
2017-08-21 16:43 ` [PATCH 3/4] misc: isl29020: " Arvind Yadav

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

all inboxes | Powered by JetHome®