diff options
| author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2026-01-19 14:19:51 +0200 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-01-21 19:50:54 -0800 |
| commit | 7bf588dc62a05c1866efe098e1b188fd879aa2cf (patch) | |
| tree | dbdba3e6e4d0e8799f3591a7827661ae55b5ae8b | |
| parent | 331cf8fc1855c2c750cbc3fb797e71ac8e4428cf (diff) | |
net: phylink: simplify phylink_resolve() -> phylink_major_config() path
This is a trivial change with no functional effect which replaces the
pattern:
if (a) {
if (b) {
do_stuff();
}
}
with:
if (a && b) {
do_stuff();
};
The purpose is to reduce the delta of a subsequent functional change.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20260119121954.1624535-2-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
| -rw-r--r-- | drivers/net/phy/phylink.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index c8fd6b91cdd4..f29cd4d7aca2 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1684,18 +1684,16 @@ static void phylink_resolve(struct work_struct *w) if (pl->act_link_an_mode != MLO_AN_FIXED) phylink_apply_manual_flow(pl, &link_state); - if (mac_config) { - if (link_state.interface != pl->link_config.interface) { - /* The interface has changed, force the link down and - * then reconfigure. - */ - if (cur_link_state) { - phylink_link_down(pl); - cur_link_state = false; - } - phylink_major_config(pl, false, &link_state); - pl->link_config.interface = link_state.interface; + if (mac_config && link_state.interface != pl->link_config.interface) { + /* The interface has changed, so force the link down and then + * reconfigure. + */ + if (cur_link_state) { + phylink_link_down(pl); + cur_link_state = false; } + phylink_major_config(pl, false, &link_state); + pl->link_config.interface = link_state.interface; } /* If configuration of the interface failed, force the link down |
