Re: [PATCH v2][next] net: wwan: mhi_wwan_mbim: Avoid -Wflex-array-member-not-at-end warning
From: Gustavo A. R. Silva
Date: Tue Nov 25 2025 - 04:08:03 EST
On 11/25/25 18:02, Loic Poulain wrote:
On Tue, Nov 25, 2025 at 5:27 AM Gustavo A. R. Silva
<gustavoars@xxxxxxxxxx> wrote:
Use DEFINE_RAW_FLEX() to avoid a -Wflex-array-member-not-at-end warning.
Remove fixed-size array struct usb_cdc_ncm_dpe16 dpe16[2]; from struct
mbim_tx_hdr, so that flex-array member struct mbim_tx_hdr::ndp16.dpe16[]
ends last in this structure.
Compensate for this by using the DEFINE_RAW_FLEX() helper to declare the
on-stack struct instance that contains struct usb_cdc_ncm_ndp16 as a
member. Adjust the rest of the code, accordingly.
So, with these changes fix the following warning:
drivers/net/wwan/mhi_wwan_mbim.c:81:34: 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@xxxxxxxxxx>
I just noticed there’s a V2, so:
Reviewed-by: Loic Poulain <loic.poulain@xxxxxxxxxxxxxxxx>
Thanks, Loic. :)
-Gustavo