diff mbox series

[v5,3/7] watchdog: f71808e_wdt: constify static array

Message ID 9720c5a1efcef861da68b693453bb3eb3c21af37.1628525954.git-series.a.fatoum@pengutronix.de
State New
Headers show
Series [v5,1/7] watchdog: f71808e_wdt: fix inaccurate report in WDIOC_GETTIMEOUT | expand

Commit Message

Ahmad Fatoum Aug. 9, 2021, 4:20 p.m. UTC
The fintek_wdt_names is meant for read-only use and is currently not
modified. Mark it const to catch future writes.

Suggested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/watchdog/f71808e_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck Aug. 28, 2021, 4:07 p.m. UTC | #1
On Mon, Aug 09, 2021 at 06:20:33PM +0200, Ahmad Fatoum wrote:
> The fintek_wdt_names is meant for read-only use and is currently not

> modified. Mark it const to catch future writes.

> 

> Suggested-by: Guenter Roeck <linux@roeck-us.net>

> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>


Reviewed-by: Guenter Roeck <linux@roeck-us.net>


> ---

>  drivers/watchdog/f71808e_wdt.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c

> index 3a0b29cb5854..8913747517fa 100644

> --- a/drivers/watchdog/f71808e_wdt.c

> +++ b/drivers/watchdog/f71808e_wdt.c

> @@ -112,7 +112,7 @@ MODULE_PARM_DESC(start_withtimeout, "Start watchdog timer on module load with"

>  enum chips { f71808fg, f71858fg, f71862fg, f71868, f71869, f71882fg, f71889fg,

>  	     f81803, f81865, f81866};

>  

> -static const char *f71808e_names[] = {

> +static const char * const f71808e_names[] = {

>  	"f71808fg",

>  	"f71858fg",

>  	"f71862fg",
diff mbox series

Patch

diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c
index 3a0b29cb5854..8913747517fa 100644
--- a/drivers/watchdog/f71808e_wdt.c
+++ b/drivers/watchdog/f71808e_wdt.c
@@ -112,7 +112,7 @@  MODULE_PARM_DESC(start_withtimeout, "Start watchdog timer on module load with"
 enum chips { f71808fg, f71858fg, f71862fg, f71868, f71869, f71882fg, f71889fg,
 	     f81803, f81865, f81866};
 
-static const char *f71808e_names[] = {
+static const char * const f71808e_names[] = {
 	"f71808fg",
 	"f71858fg",
 	"f71862fg",