drivers: watchdog: booke_wdt: add __ro_after_init to booke_wdt_info
PATCH 1/1 drivers: watchdog: booke_wdt: add __ro_after_init to booke_wdt_info
The object booke_wdt_info of watchdog_info structure is not modified after getting initialized by booke_wdt_init. Apart from getting referenced in init it is also stored in the info field of watchdog_device structure which is of type const struct watchdog_info *info. So, it becomes read only after init and therefore add __ro_after_init to it's declaration.
--- drivers/watchdog/booke_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/booke_wdt.c +1 -1
@@ -192,7 +192,7 @@ static int booke_wdt_set_timeout(struct watchdog_device *wdt_dev,return 0 ; } -static struct watchdog_info booke_wdt_info = { +static struct watchdog_info booke_wdt_info__ro_after_init = { .options =WDIOF_SETTIMEOUT |WDIOF_KEEPALIVEPING , .identity ="PowerPC Book-E Watchdog" , };
Signature · 1 line
1.9.1
Quoted 8 lines · Bhumika Goyal
The object
booke_wdt_infoofwatchdog_infostructure is not modified after getting initialized bybooke_wdt_init. Apart from getting referenced in init it is also stored in the info field ofwatchdog_devicestructure which is of type const structwatchdog_info*info. So, it becomes read only after init and therefore add__ro_after_initto it's declaration.Signed-off-by Bhumika Goyal <[email protected]>
Quoted 18 lines
--- drivers/watchdog/booke_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/watchdog/booke_wdt.c +1
-1@@ -192,7 +192,7 @@ static int booke_wdt_set_timeout(struct watchdog_device *wdt_dev,return 0 ; } -static struct watchdog_info booke_wdt_info = { +static struct watchdog_info booke_wdt_info__ro_after_init = { .options =WDIOF_SETTIMEOUT |WDIOF_KEEPALIVEPING , .identity ="PowerPC Book-E Watchdog" , };