[PATCH net-next 09/11] net: stmmac: ingenic: simplify x2000 mac_set_mode()
Jakub Kicinski
kuba at kernel.org
Wed Nov 5 17:18:48 PST 2025
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) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c:142:2: note: uninitialized use occurs here
142 | val |= FIELD_PREP(MACPHYC_PHY_INFT_MASK, phy_intf_sel);
| ^~~
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c:128:9: note: remove the 'if' if its condition is always true
128 | } else if (phy_intf_sel == PHY_INTF_SEL_RGMII) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c:123:18: note: initialize the variable 'val' to silence this warning
123 | unsigned int val;
| ^
| = 0
--
pw-bot: cr
More information about the linux-arm-kernel
mailing list