smb: smb2pdu.h: Avoid -Wflex-array-member-not-at-end warnings for-next
authorGustavo A. R. Silva <gustavoars@kernel.org>
Thu, 11 Apr 2024 15:35:42 +0000 (09:35 -0600)
committerSteve French <stfrench@microsoft.com>
Sat, 27 Apr 2024 19:39:43 +0000 (14:39 -0500)
commit8f03ed91d75edc5dcd05a764aa4345567f211b16
tree03b5edbbbc8ae26e277afbdcf897212d301e8a67
parentd43df69f3879f32fcc08d92ec47bff86ae0fcfaa
smb: smb2pdu.h: Avoid -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.

So, in order to avoid ending up with a flexible-array member in the
middle of multiple other structs, we use the `__struct_group()` helper
to separate the flexible array from the rest of the members in the
flexible structure, and use the tagged `struct create_context_hdr`
instead of `struct create_context`.

So, with these changes, fix 51 of the following warnings[1]:

fs/smb/client/../common/smb2pdu.h:1225:31: 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/772526a39be3dd4db39e71497f0a9893
Link: https://github.com/KSPP/linux/issues/202
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2pdu.h
fs/smb/common/smb2pdu.h
fs/smb/server/smb2pdu.h