watchdog: constify watchdog_info structures
authorBhumika Goyal <bhumirks@gmail.com>
Mon, 26 Dec 2016 17:05:11 +0000 (22:35 +0530)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 24 Feb 2017 22:00:23 +0000 (14:00 -0800)
commit6c368932f0d885e54b8af06d699b6d559e86f0cd
tree257a484b5c156cae315a9c527669b9d9e64fe90f
parentcb5f9d406d50fc01c6564956ed9317614e665208
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>
12 files changed:
drivers/watchdog/bcm7038_wdt.c
drivers/watchdog/bcm_kona_wdt.c
drivers/watchdog/cadence_wdt.c
drivers/watchdog/da9052_wdt.c
drivers/watchdog/da9055_wdt.c
drivers/watchdog/digicolor_wdt.c
drivers/watchdog/imgpdc_wdt.c
drivers/watchdog/kempld_wdt.c
drivers/watchdog/lpc18xx_wdt.c
drivers/watchdog/rn5t618_wdt.c
drivers/watchdog/sbsa_gwdt.c
drivers/watchdog/w83627hf_wdt.c