[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<PAXPR04MB85104CA04EA6BE1DFFFE7E7588CDA@PAXPR04MB8510.eurprd04.prod.outlook.com>
Date: Thu, 13 Nov 2025 01:35:40 +0000
From: Wei Fang <wei.fang@....com>
To: Andrew Lunn <andrew@...n.ch>
CC: Shenwei Wang <shenwei.wang@....com>, Clark Wang <xiaoning.wang@....com>,
"andrew+netdev@...n.ch" <andrew+netdev@...n.ch>, "davem@...emloft.net"
<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
"eric@...int.com" <eric@...int.com>, "imx@...ts.linux.dev"
<imx@...ts.linux.dev>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net-next 1/5] net: fec: remove useless conditional
preprocessor directives
> On Tue, Nov 11, 2025 at 06:00:53PM +0800, Wei Fang wrote:
> > The conditional preprocessor directive "#if !defined(CONFIG_M5272)" was
> > added due to build errors on MCF5272 platform, see commit d13919301d9a
> > ("net: fec: Fix build for MCF5272"). The compilation error was caused by
> > some register macros not being defined on the MCF5272 platform. However,
> > this preprocessor directive is not needed in some parts of the driver.
> > First, removing it will not cause compilation errors. Second, these parts
> > will check quirks, which do not exist on the MCF7527 platform. Therefore,
> > we can safely delete these useless preprocessor directives.
>
> > @@ -2515,9 +2513,7 @@ static int fec_enet_mii_probe(struct net_device
> *ndev)
> > phy_set_max_speed(phy_dev, 1000);
> > phy_remove_link_mode(phy_dev,
> > ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
> > -#if !defined(CONFIG_M5272)
> > phy_support_sym_pause(phy_dev);
> > -#endif
> > }
>
> I think the explanation could be better.
>
> I assume the M5272 only supported Fast Ethernet, so fep->quirks &
> FEC_QUIRK_HAS_GBIT was never true?
>From the driver, ColdFire platforms do not have the quirks, so it is
never be true for these platforms.
>
> > else
> > phy_set_max_speed(phy_dev, 100);
> > @@ -4400,11 +4396,9 @@ fec_probe(struct platform_device *pdev)
> > fep->num_rx_queues = num_rx_qs;
> > fep->num_tx_queues = num_tx_qs;
> >
> > -#if !defined(CONFIG_M5272)
> > /* default enable pause frame auto negotiation */
> > if (fep->quirks & FEC_QUIRK_HAS_GBIT)
> > fep->pause_flag |= FEC_PAUSE_FLAG_AUTONEG;
> > -#endif
>
> Same here?
>
> Maybe the commit message should actually say that M5272 only supported
> Fast Ethernet, so these conditions cannot be true, and so the #ifdef
> guard can be removed.
>
Yeah, I will improve the commit message in v2.
>
> ---
> pw-bot: cr
Powered by blists - more mailing lists