[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aQwAExA7bAgwNkdI@shell.armlinux.org.uk>
Date: Thu, 6 Nov 2025 01:55:31 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
linux-arm-kernel@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com,
Maxime Coquelin <mcoquelin.stm32@...il.com>, netdev@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next 09/11] net: stmmac: ingenic: simplify x2000
mac_set_mode()
On Wed, Nov 05, 2025 at 05:18:48PM -0800, Jakub Kicinski wrote:
> On Wed, 05 Nov 2025 13:26:53 +0000 Russell King (Oracle) wrote:
> > As per the previous commit, we have validated that the phy_intf_sel
> > value is one that is permissible for this SoC, so there is no need to
> > handle invalid PHY interface modes. We can also apply the other
> > configuration based upon the phy_intf_sel value rather than the
> > PHY interface mode.
>
> clang sayeth:
>
> drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c:128:13: warning: variable 'val' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
> 128 | } else if (phy_intf_sel == PHY_INTF_SEL_RGMII) {
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Clang can't know that phy_intf_sel will only ever be one of
PHY_INTF_SEL_RMII or PHY_INTF_SEL_RGMII here (its already been
validated as such by the only caller of this function.)
I guess the way around this warning is to move:
val |= FIELD_PREP(MACPHYC_PHY_INFT_MASK, phy_intf_sel);
up and make it a simple assignment, and make the others |=.
That's the code I originally had before I attempted to minimise the
noise in the patches. :(
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists