Skip to contentSkip to conversation

watchdog: exar: Shorten identity name to fit correctly

PATCH In review Kees Cook 2 participants 2 messages Apr 15, 2025 Watchdog device drivers

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 watchdog: exar: Shorten identity name to fit correctly

The static initializer for struct watchdog_info::identity is too long and gets initialized without a trailing NUL byte. Since the length of "identity" is part of UAPI and tied to ioctls, just shorten the name of the device. Avoids the warning seen with GCC 15's -Wunterminated-string-initialization option:

drivers/watchdog/exar_wdt.c:224:27: warning: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (33 chars into 32 available) [-Wunterminated-string-initialization]
224 | .identity = "Exar/MaxLinear XR28V38x Watchdog",

      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes 81126222bd3a ("watchdog: Exar/MaxLinear XR28V38x driver")

---
Cc: Wim Van Sebroeck <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: [email protected]

---
 drivers/watchdog/exar_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/exar_wdt.c +1 -1
index 7c61ff343271..c2e3bb08df89 100644
@@ -221,7 +221,7 @@ static const struct watchdog_info exar_wdt_info = {
 	.options	= WDIOF_KEEPALIVEPING |
 			  WDIOF_SETTIMEOUT |
 			  WDIOF_MAGICCLOSE,
-	.identity	= "Exar/MaxLinear XR28V38x Watchdog",
+	.identity	= "Exar XR28V38x Watchdog",
 };
 
 static const struct watchdog_ops exar_wdt_ops = {
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Kees Cook

The static initializer for struct watchdog_info::identity is too long and gets initialized without a trailing NUL byte. Since the length of "identity" is part of UAPI and tied to ioctls, just shorten the name of the device. Avoids the warning seen with GCC 15's -Wunterminated-string-initialization option:

Quoted 6 lines

drivers/watchdog/exar_wdt.c:224:27: warning: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (33 chars into 32 available) [-Wunterminated-string-initialization]
224 | .identity = "Exar/MaxLinear XR28V38x Watchdog",

       |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes 81126222bd3a ("watchdog: Exar/MaxLinear XR28V38x driver")
Quoted 21 lines

---
Cc: Wim Van Sebroeck <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: [email protected]

---
  drivers/watchdog/exar_wdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/exar_wdt.c +1 -1
index 7c61ff343271..c2e3bb08df89 100644
@@ -221,7 +221,7 @@ static const struct watchdog_info exar_wdt_info = {
  	.options	= WDIOF_KEEPALIVEPING |
  			  WDIOF_SETTIMEOUT |
  			  WDIOF_MAGICCLOSE,
-	.identity	= "Exar/MaxLinear XR28V38x Watchdog",
+	.identity	= "Exar XR28V38x Watchdog",
  };
 
  static const struct watchdog_ops exar_wdt_ops = {