LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
To: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rikard Falkeborn <rikard.falkeborn@gmail.com>
Subject: [PATCH 3/3] watchdog: mpc8xxx_wdt: Constify static struct watchdog_ops
Date: Wed, 28 Jul 2021 00:30:42 +0200	[thread overview]
Message-ID: <20210727223042.48150-4-rikard.falkeborn@gmail.com> (raw)
In-Reply-To: <20210727223042.48150-1-rikard.falkeborn@gmail.com>

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>
---
 drivers/watchdog/mpc8xxx_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
index 2f7ded32e878..1c569be72ea2 100644
--- a/drivers/watchdog/mpc8xxx_wdt.c
+++ b/drivers/watchdog/mpc8xxx_wdt.c
@@ -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,
-- 
2.32.0


  parent reply	other threads:[~2021-07-27 22:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 22:30 [PATCH 0/3] drivers/watchdog: " Rikard Falkeborn
2021-07-27 22:30 ` [PATCH 1/3] watchdog: sl28cpld_wdt: " Rikard Falkeborn
2021-07-28 18:04   ` Guenter Roeck
2021-07-27 22:30 ` [PATCH 2/3] watchdog: tqmx86: " Rikard Falkeborn
2021-07-28 18:04   ` Guenter Roeck
2021-07-27 22:30 ` Rikard Falkeborn [this message]
2021-07-28 18:04   ` [PATCH 3/3] watchdog: mpc8xxx_wdt: " Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210727223042.48150-4-rikard.falkeborn@gmail.com \
    --to=rikard.falkeborn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=wim@linux-watchdog.org \
    --subject='Re: [PATCH 3/3] watchdog: mpc8xxx_wdt: Constify static struct watchdog_ops' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).