Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mei: Avoid a bunch of -Wflex-array-member-not-at-end warnings

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

After commit 40292383640a ("mei: revamp mei extension header structure layout.")
it seems that flexible-array member `data` in `struct mei_ext_hdr` is no longer
needed. So, remove it and, with that, fix 45 of the following
-Wflex-array-member-not-at-end warnings[1] in drivers/misc/mei/:

drivers/misc/mei/hw.h:280:28: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Link: https://gist.github.com/GustavoARSilva/62dcc235555a6b29b506269edb83da0b [1]
Link: https://github.com/KSPP/linux/issues/202
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/ZgHYE2s5kBGlv1cw@neat
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Gustavo A. R. Silva and committed by
Greg Kroah-Hartman
355f6a29 115ee553

-2
-2
drivers/misc/mei/hw.h
··· 247 247 * struct mei_ext_hdr - extend header descriptor (TLV) 248 248 * @type: enum mei_ext_hdr_type 249 249 * @length: length excluding descriptor 250 - * @data: the extended header payload 251 250 */ 252 251 struct mei_ext_hdr { 253 252 u8 type; 254 253 u8 length; 255 - u8 data[]; 256 254 } __packed; 257 255 258 256 /**