watchdog: mpc8xxx_wdt: Constify static struct watchdog_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Tue, 27 Jul 2021 22:30:42 +0000 (00:30 +0200)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sun, 22 Aug 2021 08:28:10 +0000 (10:28 +0200)
The struct mpc8xxx_wdt_ops is only assigned to the ops pointer in the
watchdog_device struct, which is a pointer to const struct watchdog_ops.
Make it const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210727223042.48150-4-rikard.falkeborn@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/mpc8xxx_wdt.c

index 2f7ded32e8780fc35ab1cac78aa316810ef85cf5..1c569be72ea29fd90744f51d31f964ba7ff8722f 100644 (file)
@@ -118,7 +118,7 @@ static struct watchdog_info mpc8xxx_wdt_info = {
        .identity = "MPC8xxx",
 };
 
-static struct watchdog_ops mpc8xxx_wdt_ops = {
+static const struct watchdog_ops mpc8xxx_wdt_ops = {
        .owner = THIS_MODULE,
        .start = mpc8xxx_wdt_start,
        .ping = mpc8xxx_wdt_ping,