]> Gentwo Git Trees - linux/.git/commit
net: wwan: mhi_wwan_mbim: Avoid -Wflex-array-member-not-at-end warning
authorGustavo A. R. Silva <gustavoars@kernel.org>
Thu, 27 Nov 2025 03:12:03 +0000 (12:12 +0900)
committerJakub Kicinski <kuba@kernel.org>
Fri, 28 Nov 2025 01:45:18 +0000 (17:45 -0800)
commiteeecf5d3a3a484cedfa3f2f87e6d51a7390ed960
tree7a1ca2c0f1859431fa42ae57e165abacc02d195b
parent858b1d07e49106a302cc7c7fbeee4fb2698573c9
net: wwan: mhi_wwan_mbim: Avoid -Wflex-array-member-not-at-end warning

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]

Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wwan/mhi_wwan_mbim.c