Skip to content

Commit

Permalink
watchdog: mpc8xxx_wdt: Constify static struct watchdog_ops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rikard Falkeborn authored and Wim Van Sebroeck committed Aug 22, 2021
1 parent ade448c commit 47b45c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/watchdog/mpc8xxx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 47b45c4

Please sign in to comment.