* [PATCH] watchdog: ziirave: constify i2c_device_id
@ 2017-08-21 16:48 Arvind Yadav
2017-08-30 3:26 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-08-21 16:48 UTC (permalink / raw)
To: wim, linux; +Cc: linux-kernel, linux-watchdog
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/watchdog/ziirave_wdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/ziirave_wdt.c b/drivers/watchdog/ziirave_wdt.c
index b4e0cea..d3594aa 100644
--- a/drivers/watchdog/ziirave_wdt.c
+++ b/drivers/watchdog/ziirave_wdt.c
@@ -737,7 +737,7 @@ static int ziirave_wdt_remove(struct i2c_client *client)
return 0;
}
-static struct i2c_device_id ziirave_wdt_id[] = {
+static const struct i2c_device_id ziirave_wdt_id[] = {
{ "rave-wdt", 0 },
{ }
};
--
2.7.4
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: watchdog: ziirave: constify i2c_device_id
2017-08-21 16:48 [PATCH] watchdog: ziirave: constify i2c_device_id Arvind Yadav
@ 2017-08-30 3:26 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2017-08-30 3:26 UTC (permalink / raw)
To: Arvind Yadav; +Cc: wim, linux-kernel, linux-watchdog
On Mon, Aug 21, 2017 at 10:18:38PM +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>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/ziirave_wdt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/ziirave_wdt.c b/drivers/watchdog/ziirave_wdt.c
> index b4e0cea..d3594aa 100644
> --- a/drivers/watchdog/ziirave_wdt.c
> +++ b/drivers/watchdog/ziirave_wdt.c
> @@ -737,7 +737,7 @@ static int ziirave_wdt_remove(struct i2c_client *client)
> return 0;
> }
>
> -static struct i2c_device_id ziirave_wdt_id[] = {
> +static const struct i2c_device_id ziirave_wdt_id[] = {
> { "rave-wdt", 0 },
> { }
> };
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-30 3:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-21 16:48 [PATCH] watchdog: ziirave: constify i2c_device_id Arvind Yadav
2017-08-30 3:26 ` Guenter Roeck
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®