smb: smb2pdu.h: Avoid -Wflex-array-member-not-at-end warnings
authorGustavo A. R. Silva <gustavoars@kernel.org>
Thu, 11 Apr 2024 15:35:42 +0000 (09:35 -0600)
committerSteve French <stfrench@microsoft.com>
Thu, 2 May 2024 18:07:10 +0000 (13:07 -0500)
commitae4f73e84cb190a12e0ca78b57e58c5563b3acae
tree8242ee62f611567ec26e832f8bbea555fd95fa54
parente67572cd2204894179d89bd7b984072f19313b03
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