public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next 3/3] net: phylink: remove "using_mac_select_pcs"
Date: Wed, 9 Oct 2024 15:29:38 +0300	[thread overview]
Message-ID: <20241009122938.qmrq6csapdghwry3@skbuf> (raw)
In-Reply-To: <E1syBPE-006Unh-TL@rmk-PC.armlinux.org.uk>

On Tue, Oct 08, 2024 at 03:41:44PM +0100, Russell King (Oracle) wrote:
> With DSA's implementation of the mac_select_pcs() method removed, we
> can now remove the detection of mac_select_pcs() implementation.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/net/phy/phylink.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> index 4309317de3d1..8f86599d3d78 100644
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
> @@ -79,7 +79,6 @@ struct phylink {
>  	unsigned int pcs_state;
>  
>  	bool mac_link_dropped;
> -	bool using_mac_select_pcs;
>  
>  	struct sfp_bus *sfp_bus;
>  	bool sfp_may_have_phy;
> @@ -661,12 +660,12 @@ static int phylink_validate_mac_and_pcs(struct phylink *pl,
>  	int ret;
>  
>  	/* Get the PCS for this interface mode */
> -	if (pl->using_mac_select_pcs) {
> +	if (pl->mac_ops->mac_select_pcs) {
>  		pcs = pl->mac_ops->mac_select_pcs(pl->config, state->interface);
>  		if (IS_ERR(pcs))
>  			return PTR_ERR(pcs);
>  	} else {
> -		pcs = pl->pcs;
> +		pcs = NULL;

The assignment from the "else" branch could have been folded into the
variable initialization.

Also, maybe a word in the commit message would be good about why the
"pcs = pl->pcs" line became "pcs = NULL". I get the impression that
these are 2 logical changes in one patch. This second aspect I'm
highlighting seems to be cleaning up the last remnants of phylink_set_pcs().
Since all phylink users have been converted to mac_select_pcs(), there's
no other possible value for "pl->pcs" than NULL if "using_mac_select_pcs"
is true.

I'm not 100% sure that this is the case, but cross-checking with the git
history, it seems to be the case. Commit 1054457006d4 ("net: phy:
phylink: fix DSA mac_select_pcs() introduction") was merged on Feb 21,2022,
and commit a5081bad2eac ("net: phylink: remove phylink_set_pcs()") on
Feb 26. So it seems plausible that this fixup could have been made as
soon as Feb 26, 2022. Please confirm.

>  	}
>  
>  	if (pcs) {

  reply	other threads:[~2024-10-09 12:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 14:41 [PATCH net-next 0/3] Removing more phylink cruft Russell King (Oracle)
2024-10-08 14:41 ` [PATCH net-next 1/3] net: dsa: remove dsa_port_phylink_mac_select_pcs() Russell King (Oracle)
2024-10-09 12:17   ` Vladimir Oltean
2024-10-08 14:41 ` [PATCH net-next 2/3] net: dsa: mv88e6xxx: return NULL when no PCS is present Russell King (Oracle)
2024-10-09 12:18   ` Vladimir Oltean
2024-10-08 14:41 ` [PATCH net-next 3/3] net: phylink: remove "using_mac_select_pcs" Russell King (Oracle)
2024-10-09 12:29   ` Vladimir Oltean [this message]
2024-10-09 12:33     ` Vladimir Oltean
2024-10-10  9:47     ` Paolo Abeni
2024-10-10 11:21     ` Russell King (Oracle)
2024-10-10 13:00       ` Russell King (Oracle)
2024-10-11 10:39         ` Vladimir Oltean
2024-10-11 10:58           ` Russell King (Oracle)
2024-10-11 12:54             ` Vladimir Oltean
2024-10-11 17:51               ` Russell King (Oracle)
2024-10-12 10:27                 ` Vladimir Oltean

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=20241009122938.qmrq6csapdghwry3@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    /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