2021-11-28 22:05:32

by Rikard Falkeborn

[permalink] [raw]
Subject: [PATCH] ipmi/watchdog: Constify ident

ident is not modified and can be made const to allow the compiler to put
it in read-only memory.

Signed-off-by: Rikard Falkeborn <[email protected]>
---
drivers/char/ipmi/ipmi_watchdog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
index 883b4a341012..0604abdd249a 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -668,7 +668,7 @@ static int ipmi_heartbeat(void)
return rv;
}

-static struct watchdog_info ident = {
+static const struct watchdog_info ident = {
.options = 0, /* WDIOF_SETTIMEOUT, */
.firmware_version = 1,
.identity = "IPMI"
--
2.34.1



2021-12-01 19:42:27

by Corey Minyard

[permalink] [raw]
Subject: Re: [PATCH] ipmi/watchdog: Constify ident

On Sun, Nov 28, 2021 at 11:01:54PM +0100, Rikard Falkeborn wrote:
> ident is not modified and can be made const to allow the compiler to put
> it in read-only memory.

In my queue for next release. Thanks.

-corey

>
> Signed-off-by: Rikard Falkeborn <[email protected]>
> ---
> drivers/char/ipmi/ipmi_watchdog.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
> index 883b4a341012..0604abdd249a 100644
> --- a/drivers/char/ipmi/ipmi_watchdog.c
> +++ b/drivers/char/ipmi/ipmi_watchdog.c
> @@ -668,7 +668,7 @@ static int ipmi_heartbeat(void)
> return rv;
> }
>
> -static struct watchdog_info ident = {
> +static const struct watchdog_info ident = {
> .options = 0, /* WDIOF_SETTIMEOUT, */
> .firmware_version = 1,
> .identity = "IPMI"
> --
> 2.34.1
>