summaryrefslogtreecommitdiff
path: root/drivers/watchdog/cadence_wdt.c
diff options
context:
space:
mode:
authorBhumika Goyal <bhumirks@gmail.com>2016-12-26 20:05:11 +0300
committerGuenter Roeck <linux@roeck-us.net>2017-02-25 01:00:23 +0300
commit6c368932f0d885e54b8af06d699b6d559e86f0cd (patch)
tree257a484b5c156cae315a9c527669b9d9e64fe90f /drivers/watchdog/cadence_wdt.c
parentcb5f9d406d50fc01c6564956ed9317614e665208 (diff)
downloadlinux-6c368932f0d885e54b8af06d699b6d559e86f0cd.tar.xz
watchdog: constify watchdog_info structures
Declare watchdog_info structures as const as they are only stored in the info field of watchdog_device structures. This field is of type const struct watchdog_info *, so watchdog_info structures having this property can be declared const too. Done using Coccinelle: @r1 disable optional_qualifier@ identifier i; position p; @@ static struct watchdog_info i@p={...}; @ok@ identifier r1.i; position p; struct watchdog_device obj; @@ obj.info=&i@p; @bad@ position p!={r1.p,ok.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct watchdog_info i; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Acked-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/watchdog/cadence_wdt.c')
-rw-r--r--drivers/watchdog/cadence_wdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index 98acef72334d..8d61e8bfe60b 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -262,7 +262,7 @@ static irqreturn_t cdns_wdt_irq_handler(int irq, void *dev_id)
* Info structure used to indicate the features supported by the device
* to the upper layers. This is defined in watchdog.h header file.
*/
-static struct watchdog_info cdns_wdt_info = {
+static const struct watchdog_info cdns_wdt_info = {
.identity = "cdns_wdt watchdog",
.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING |
WDIOF_MAGICCLOSE,