]> www.infradead.org Git - users/dwmw2/linux.git/commit
rtc: cros-ec: Avoid a couple of -Wflex-array-member-not-at-end warnings
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 14 Mar 2025 08:30:54 +0000 (19:00 +1030)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 17 Mar 2025 22:32:15 +0000 (23:32 +0100)
commit0176188220a7822b7a5f57f971d8af291d05e98c
tree0788d1200aa3d5f008f6f85db453f4202f17057a
parent6c2b833525ebce518ff7056b2700dfe3d0244d8b
rtc: cros-ec: Avoid a couple of -Wflex-array-member-not-at-end warnings

Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition 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/rtc/rtc-cros-ec.c:62:40: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/rtc/rtc-cros-ec.c:40: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>
Link: https://lore.kernel.org/r/Z9PpPg06OK8ghNvm@kspp
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-cros-ec.c