]> www.infradead.org Git - users/jedix/linux-maple.git/commit
watchdog: cros-ec: Avoid -Wflex-array-member-not-at-end warning
authorGustavo A. R. Silva <gustavoars@kernel.org>
Thu, 27 Mar 2025 17:12:11 +0000 (11:12 -0600)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sat, 24 May 2025 14:57:52 +0000 (16:57 +0200)
commitf8cdcc98c9833b8527121922b374148cafb8108d
tree983c3cce7c04c9ee4c961fb1c3f0af55b1424df9
parent325f510fcd9cda5a44bcb662b74ba4e3dabaca10
watchdog: cros-ec: Avoid -Wflex-array-member-not-at-end warning

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Use the `DEFINE_RAW_FLEX()` helper for on-stack definitions of
a flexible structure where the size of the flexible-array member
is known at compile-time, and refactor the rest of the code,
accordingly.

So, with these changes, fix the following warning:

drivers/watchdog/cros_ec_wdt.c:29:40: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/Z-WG6_uhWsy_FCq3@kspp
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/cros_ec_wdt.c