All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: ftsteutates: constify i2c_device_id
@ 2017-08-19 19:26 Arvind Yadav
  2017-08-30  0:45 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-08-19 19:26 UTC (permalink / raw)
  To: jdelvare, linux; +Cc: linux-kernel, linux-hwmon

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/hwmon/ftsteutates.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/ftsteutates.c b/drivers/hwmon/ftsteutates.c
index 0f0277e..317e45f 100644
--- a/drivers/hwmon/ftsteutates.c
+++ b/drivers/hwmon/ftsteutates.c
@@ -60,7 +60,7 @@
 
 static const unsigned short normal_i2c[] = { 0x73, I2C_CLIENT_END };
 
-static struct i2c_device_id fts_id[] = {
+static const struct i2c_device_id fts_id[] = {
 	{ "ftsteutates", 0 },
 	{ }
 };
-- 
2.7.4


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

* Re: hwmon: ftsteutates: constify i2c_device_id
  2017-08-19 19:26 [PATCH] hwmon: ftsteutates: constify i2c_device_id Arvind Yadav
@ 2017-08-30  0:45 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2017-08-30  0:45 UTC (permalink / raw)
  To: Arvind Yadav; +Cc: jdelvare, linux-kernel, linux-hwmon

On Sun, Aug 20, 2017 at 12:56:34AM +0530, Arvind Yadav wrote:
> 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>

Appled to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/ftsteutates.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/ftsteutates.c b/drivers/hwmon/ftsteutates.c
> index 0f0277e..317e45f 100644
> --- a/drivers/hwmon/ftsteutates.c
> +++ b/drivers/hwmon/ftsteutates.c
> @@ -60,7 +60,7 @@
>  
>  static const unsigned short normal_i2c[] = { 0x73, I2C_CLIENT_END };
>  
> -static struct i2c_device_id fts_id[] = {
> +static const struct i2c_device_id fts_id[] = {
>  	{ "ftsteutates", 0 },
>  	{ }
>  };

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-19 19:26 [PATCH] hwmon: ftsteutates: constify i2c_device_id Arvind Yadav
2017-08-30  0:45 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.