[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210728180416.GA1663715@roeck-us.net>
Date: Wed, 28 Jul 2021 11:04:16 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Rikard Falkeborn <rikard.falkeborn@...il.com>
Cc: Wim Van Sebroeck <wim@...ux-watchdog.org>,
linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] watchdog: sl28cpld_wdt: Constify static struct
watchdog_ops
On Wed, Jul 28, 2021 at 12:30:40AM +0200, Rikard Falkeborn wrote:
> The struct sl28cpld_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@...il.com>
Reviewed-by: Guenter Roeck <linux@...ck-us.net>
> ---
> drivers/watchdog/sl28cpld_wdt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/sl28cpld_wdt.c b/drivers/watchdog/sl28cpld_wdt.c
> index 2de93298475f..9ce456f09f73 100644
> --- a/drivers/watchdog/sl28cpld_wdt.c
> +++ b/drivers/watchdog/sl28cpld_wdt.c
> @@ -108,7 +108,7 @@ static const struct watchdog_info sl28cpld_wdt_info = {
> .identity = "sl28cpld watchdog",
> };
>
> -static struct watchdog_ops sl28cpld_wdt_ops = {
> +static const struct watchdog_ops sl28cpld_wdt_ops = {
> .owner = THIS_MODULE,
> .start = sl28cpld_wdt_start,
> .stop = sl28cpld_wdt_stop,
> --
> 2.32.0
>
Powered by blists - more mailing lists