From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Subject: [PATCH net-next 3/5] net: phylink: move MLO_AN_PHY resolve handling to if() statement
Date: Fri, 08 Nov 2024 16:01:55 +0000 [thread overview]
Message-ID: <E1t9RQp-002Fet-5W@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <Zy411lVWe2SikuOs@shell.armlinux.org.uk>
The switch() statement doesn't sit very well with the preceeding if()
statements, and results in excessive indentation that spoils code
readability. Continue cleaning this up by converting the MLO_AN_PHY
case to use an if() statmeent.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/phy/phylink.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index bb20ae5674e5..3af6368a9fbf 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1466,13 +1466,11 @@ static void phylink_resolve(struct work_struct *w)
} else if (pl->cur_link_an_mode == MLO_AN_FIXED) {
phylink_get_fixed_state(pl, &link_state);
mac_config = link_state.link;
+ } else if (pl->cur_link_an_mode == MLO_AN_PHY) {
+ link_state = pl->phy_state;
+ mac_config = link_state.link;
} else {
switch (pl->cur_link_an_mode) {
- case MLO_AN_PHY:
- link_state = pl->phy_state;
- mac_config = link_state.link;
- break;
-
case MLO_AN_INBAND:
phylink_mac_pcs_get_state(pl, &link_state);
--
2.30.2
next prev parent reply other threads:[~2024-11-08 16:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 16:01 [PATCH net-next 0/5] net: phylink: phylink_resolve() cleanups Russell King (Oracle)
2024-11-08 16:01 ` [PATCH net-next 1/5] net: phylink: move manual flow control setting Russell King (Oracle)
2024-11-08 17:34 ` Andrew Lunn
2024-11-08 17:53 ` Russell King (Oracle)
2024-11-08 16:01 ` [PATCH net-next 2/5] net: phylink: move MLO_AN_FIXED resolve handling to if() statement Russell King (Oracle)
2024-11-08 16:01 ` Russell King (Oracle) [this message]
2024-11-08 16:02 ` [PATCH net-next 4/5] net: phylink: remove switch() statement in resolve handling Russell King (Oracle)
2024-11-08 16:02 ` [PATCH net-next 5/5] net: phylink: clean up phylink_resolve() Russell King (Oracle)
2024-11-12 3:40 ` [PATCH net-next 0/5] net: phylink: phylink_resolve() cleanups patchwork-bot+netdevbpf
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=E1t9RQp-002Fet-5W@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--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).