]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: ethtool: Avoid thousands of -Wflex-array-member-not-at-end warnings
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 29 Oct 2024 21:58:47 +0000 (15:58 -0600)
committerJakub Kicinski <kuba@kernel.org>
Sun, 3 Nov 2024 19:06:58 +0000 (11:06 -0800)
commit3bd9b9abdf1563a22041b7255baea6d449902f1a
treeb8159f0c65ac80d8890488fdb0f5d17a3126b25f
parent43d3487035e9a86fad952de4240a518614240d43
net: ethtool: Avoid thousands of -Wflex-array-member-not-at-end warnings

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

Change the type of the middle struct member currently causing trouble from
`struct ethtool_link_settings` to `struct ethtool_link_settings_hdr`.

Additionally, update the type of some variables in various functions that
don't access the flexible-array member, changing them to the newly created
`struct ethtool_link_settings_hdr`. These changes are needed because the
type of the conflicting middle members changed. So, those instances that
expect the type to be `struct ethtool_link_settings` should be adjusted to
the newly created type `struct ethtool_link_settings_hdr`.

Also, adjust variable declarations to follow the reverse xmas tree
convention.

Fix 3338 of the following -Wflex-array-member-not-at-end warnings:

include/linux/ethtool.h:214:38: 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@kernel.org>
Link: https://patch.msgid.link/0bc2809fe2a6c11dd4c8a9a10d9bd65cccdb559b.1730238285.git.gustavoars@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
drivers/net/ethernet/cisco/enic/enic_ethtool.c
drivers/net/ethernet/qlogic/qede/qede_ethtool.c
include/linux/ethtool.h
net/ethtool/ioctl.c
net/ethtool/linkinfo.c
net/ethtool/linkmodes.c