drivers: watchdog: pika_wdt: add __ro_after_init to ident
PATCH 1/1 drivers: watchdog: pika_wdt: add __ro_after_init to ident
The object ident of type watchdog_info structure is not modified after getting initialized by pikawdt_init. Apart from getting referenced in init it is also passed as an argument to the function copy_to_user but this argument is of type const void *. Therefore add __ro_after_init to its declaration.
Signed-off-by Bhumika Goyal <[email protected]>
--- drivers/watchdog/pika_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/pika_wdt.c +1 -1
@@ -54,7 +54,7 @@struct timer_list timer;/* The timer that pings the watchdog */ } pikawdt_private; -static struct watchdog_info ident = { +static struct watchdog_info ident__ro_after_init = { .identity =DRV_NAME , .options =WDIOF_CARDRESET | WDIOF_SETTIMEOUT |
Signature · 1 line
1.9.1
Quoted 7 lines · Bhumika Goyal
The object ident of type
watchdog_infostructure is not modified after getting initialized bypikawdt_init. Apart from getting referenced in init it is also passed as an argument to the functioncopy_to_userbut this argument is of type const void *. Therefore add__ro_after_initto its declaration.Signed-off-by Bhumika Goyal <[email protected]>
Reviewed-by Guenter Roeck <[email protected]>
Quoted 18 lines
--- drivers/watchdog/pika_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/watchdog/pika_wdt.c +1
-1@@ -54,7 +54,7 @@struct timer_list timer;/* The timer that pings the watchdog */ } pikawdt_private; -static struct watchdog_info ident = { +static struct watchdog_info ident__ro_after_init = { .identity =DRV_NAME , .options =WDIOF_CARDRESET | WDIOF_SETTIMEOUT |