[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cfc31be3-935d-432f-aa7a-38976c7ca954@lunn.ch>
Date: Mon, 12 Feb 2024 16:04:49 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Csókás Bence <csokas.bence@...lan.hu>
Cc: netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Wei Fang <wei.fang@....com>, Shenwei Wang <shenwei.wang@....com>,
Clark Wang <xiaoning.wang@....com>,
NXP Linux Team <linux-imx@....com>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Francesco Dolcini <francesco.dolcini@...adex.com>,
Marc Kleine-Budde <mkl@...gutronix.de>
Subject: Re: [PATCH v2] net: fec: Refactor: #define magic constants
On Mon, Feb 12, 2024 at 03:49:42PM +0100, Csókás Bence wrote:
> Hi!
>
> 2024. 02. 09. 14:53 keltezéssel, Andrew Lunn írta:
> > > @@ -1181,7 +1194,7 @@ fec_restart(struct net_device *ndev)
> > > if ((fep->pause_flag & FEC_PAUSE_FLAG_ENABLE) ||
> > > ((fep->pause_flag & FEC_PAUSE_FLAG_AUTONEG) &&
> > > ndev->phydev && ndev->phydev->pause)) {
> > > - rcntl |= FEC_ENET_FCE;
> > > + rcntl |= FEC_RCR_FLOWCTL;
> >
> > This immediately stood out to me while looking at the diff. Its not
> > obvious why this is correct. Looking back, i see you removed
> > FEC_ENET_FCE, not renamed it.
>
> What do you mean? I replaced FEC_ENET_FCE with FEC_RCR_FLOWCTL, to make it
> obvious that it represents a bit in RCR (or `rcntl` as it is called on this
> line). How is that not "renaming" it?
Going from FEC_NET_ to FEC_RCR_ in itself makes me ask questions. Was
it wrong before? Is this actually a fix? Is it correct now, or is this
a cut/paste typo? Looking at the rest of the patch there is no obvious
answer. As i said, you deleted FEC_ENET_FCE, but there is no
explanation why.
So what i'm asking for is obviously correct patches. You can add the
#defines, and replace (1 << X) with one of the new macros, and it
should be obvious.
However, the change above is not obviously correct, so some
explanation is required. And it is easier to do that in a patch
dedicated to this change, with a good explanation.
Andrew
Powered by blists - more mailing lists