Skip to content

Commit

Permalink
watchdog: booke_wdt: add __ro_after_init to booke_wdt_info
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Bhumika Goyal authored and Guenter Roeck committed Feb 24, 2017
1 parent 027d89d commit 8d97005
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/watchdog/booke_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
};
Expand Down

0 comments on commit 8d97005

Please sign in to comment.