netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next 09/11] net: stmmac: ingenic: simplify x2000 mac_set_mode()
Date: Thu, 6 Nov 2025 01:55:31 +0000	[thread overview]
Message-ID: <aQwAExA7bAgwNkdI@shell.armlinux.org.uk> (raw)
In-Reply-To: <20251105171848.550f625a@kernel.org>

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!

  reply	other threads:[~2025-11-06  1:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05 13:25 [PATCH net-next 0/11] net: stmmac: ingenic: convert to set_phy_intf_sel() Russell King (Oracle)
2025-11-05 13:26 ` [PATCH net-next 01/11] net: stmmac: ingenic: move ingenic_mac_init() Russell King (Oracle)
2025-11-06  9:49   ` Maxime Chevallier
2025-11-05 13:26 ` [PATCH net-next 02/11] net: stmmac: ingenic: simplify jz4775 mac_set_mode() Russell King (Oracle)
2025-11-06  9:51   ` Maxime Chevallier
2025-11-05 13:26 ` [PATCH net-next 03/11] net: stmmac: ingenic: use PHY_INTF_SEL_xxx to select PHY interface Russell King (Oracle)
2025-11-06  9:53   ` Maxime Chevallier
2025-11-05 13:26 ` [PATCH net-next 04/11] net: stmmac: ingenic: use PHY_INTF_SEL_x directly Russell King (Oracle)
2025-11-06  9:54   ` Maxime Chevallier
2025-11-05 13:26 ` [PATCH net-next 05/11] net: stmmac: ingenic: prep PHY_INTF_SEL_x field after switch() Russell King (Oracle)
2025-11-05 13:26 ` [PATCH net-next 06/11] net: stmmac: ingenic: use stmmac_get_phy_intf_sel() Russell King (Oracle)
2025-11-05 13:26 ` [PATCH net-next 07/11] net: stmmac: ingenic: move "MAC PHY control register" debug Russell King (Oracle)
2025-11-05 13:26 ` [PATCH net-next 08/11] net: stmmac: ingenic: simplify mac_set_mode() methods Russell King (Oracle)
2025-11-05 13:26 ` [PATCH net-next 09/11] net: stmmac: ingenic: simplify x2000 mac_set_mode() Russell King (Oracle)
2025-11-06  1:18   ` Jakub Kicinski
2025-11-06  1:55     ` Russell King (Oracle) [this message]
2025-11-06  9:06   ` kernel test robot
2025-11-05 13:26 ` [PATCH net-next 10/11] net: stmmac: ingenic: pass ingenic_mac struct rather than plat_dat Russell King (Oracle)
2025-11-05 13:27 ` [PATCH net-next 11/11] net: stmmac: ingenic: use ->set_phy_intf_sel() Russell King (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aQwAExA7bAgwNkdI@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).