diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2024-10-29 15:58:47 -0600 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-11-03 11:06:58 -0800 |
commit | 3bd9b9abdf1563a22041b7255baea6d449902f1a (patch) | |
tree | b8159f0c65ac80d8890488fdb0f5d17a3126b25f /drivers/net/ethernet/cisco | |
parent | 43d3487035e9a86fad952de4240a518614240d43 (diff) |
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>
Diffstat (limited to 'drivers/net/ethernet/cisco')
-rw-r--r-- | drivers/net/ethernet/cisco/enic/enic_ethtool.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/cisco/enic/enic_ethtool.c b/drivers/net/ethernet/cisco/enic/enic_ethtool.c index f7986f2b6a17..4fe85780a950 100644 --- a/drivers/net/ethernet/cisco/enic/enic_ethtool.c +++ b/drivers/net/ethernet/cisco/enic/enic_ethtool.c @@ -129,8 +129,8 @@ static void enic_intr_coal_set_rx(struct enic *enic, u32 timer) static int enic_get_ksettings(struct net_device *netdev, struct ethtool_link_ksettings *ecmd) { + struct ethtool_link_settings_hdr *base = &ecmd->base; struct enic *enic = netdev_priv(netdev); - struct ethtool_link_settings *base = &ecmd->base; ethtool_link_ksettings_add_link_mode(ecmd, supported, 10000baseT_Full); |