[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241029110845.0f9bb1cc@kernel.org>
Date: Tue, 29 Oct 2024 11:08:45 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc: "Gustavo A. R. Silva" <gustavoars@...nel.org>, Michael Chan
<michael.chan@...adcom.com>, Andrew Lunn <andrew+netdev@...n.ch>, "David S.
Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo
Abeni <pabeni@...hat.com>, Potnuri Bharat Teja <bharat@...lsio.com>,
Christian Benvenuti <benve@...co.com>, Satish Kharat <satishkh@...co.com>,
Manish Chopra <manishc@...vell.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH 2/2][next] net: ethtool: Avoid thousands of
-Wflex-array-member-not-at-end warnings
On Tue, 29 Oct 2024 10:55:14 -0600 Gustavo A. R. Silva wrote:
> On 29/10/24 07:58, Jakub Kicinski wrote:
> > On Mon, 21 Oct 2024 13:02:27 -0600 Gustavo A. R. Silva wrote:
> >> @@ -3025,7 +3025,7 @@ static int bnxt_set_link_ksettings(struct net_device *dev,
> >> {
> >> struct bnxt *bp = netdev_priv(dev);
> >> struct bnxt_link_info *link_info = &bp->link_info;
> >> - const struct ethtool_link_settings *base = &lk_ksettings->base;
> >> + const struct ethtool_link_settings_hdr *base = &lk_ksettings->base;
> >
> > Please improve the variable ordering while at it. Longest list first,
> > so move the @base definition first.
>
> OK. This would end up looking like:
>
> const struct ethtool_link_settings_hdr *base = &lk_ksettings->base;
> struct bnxt *bp = netdev_priv(dev);
> struct bnxt_link_info *link_info = &bp->link_info;
Correct, one step at a time.
> >> @@ -62,7 +62,7 @@ static int linkmodes_reply_size(const struct ethnl_req_info *req_base,
> >> {
> >> const struct linkmodes_reply_data *data = LINKMODES_REPDATA(reply_base);
> >> const struct ethtool_link_ksettings *ksettings = &data->ksettings;
> >> - const struct ethtool_link_settings *lsettings = &ksettings->base;
> >> + const struct ethtool_link_settings_hdr *lsettings = &ksettings->base;
> >
> > here it was correct and now its not
>
> I don't think you want to change this. `lsettings` is based on `ksettings`. So,
> `ksettings` should go first. The same scenario for the one below.
In which case you need to move the init out of line.
Thanks.
Powered by blists - more mailing lists