From patchwork Fri Nov 8 16:02:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13868423 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80D5C1957F8 for ; Fri, 8 Nov 2024 16:02:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731081731; cv=none; b=Cyfyp3bEPxKi5Y6AqWUbCtU5jyqQFX645cOkon8lg7G7+X6JPlsmpqIIAHkUT4pjJEcmo6Dol6GUBnwDQqtqKyZUYIdKnRuFDFe+XVo2JcSCXe1MZUlsYnYQWtNvssDfdvyJ90PuJoRRoWT2VnQS2qUU+VcAg4HqV5LgYvnQ+VE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731081731; c=relaxed/simple; bh=tv5k0R4kEz3tOAem5oX0O/B+hKVh1mZh72XYl7yFdvI=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=VHKVEhInW2eIkW9qHkAEOqd1zOAv8f0E8VNLwBVLM1sZD0zbC8obRFJso0Fz426kqE5L3fURYWp5nad7Erh6RtBhSZ0MVdDJ5Cg73hzhosLYJ5MuNf1SAPoLftcfQsdUw7Q2gzlMm4BKGL48HvPeKtCsH1KDEMLTHJRjn556Cag= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=1eXDnPDS; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="1eXDnPDS" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RXOPMKI68I0nm6kL07Ir8wmbWUKvFch17HhVS8CWl6I=; b=1eXDnPDSU5cETCDwNcQbFmwQ46 ywLOOEk8gUd4BzWgDb5bXsKY+lU7ljBJOBkqMyHRzM9ZwN5ovgql2wanX7gqg84X8tghgf0QRlFMh dNQ4/zS84/Dql0FxaKQ5xDRonEhCBtsPCvwgkP6tkPacCmILoFQSlYvrq9hMr2RJ18i3a87ZvJRFX PMhZW52oLhNcq1lgisWkm551jQcI7MaQfD3dAeL/+A7m2WqbLJzpaHehUsrxaIjA08s2tAVkmWaUE 7oH5t2toJLzvttxWHHxDjAiBDAKGMLFmPitRGJxtHMFtqVKxDoUFumcavbd6zJ2QgEiwyB/lw89iE Z7VIFQHw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36632 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1t9RQz-0005aZ-06; Fri, 08 Nov 2024 16:02:05 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1t9RQz-002Ff5-EA; Fri, 08 Nov 2024 16:02:05 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: [PATCH net-next 5/5] net: phylink: clean up phylink_resolve() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Fri, 08 Nov 2024 16:02:05 +0000 X-Patchwork-Delegate: kuba@kernel.org Now that we have reduced the indentation level, clean up the code formatting. Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index aaeb8b11e758..b1e828a4286d 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1472,51 +1472,48 @@ static void phylink_resolve(struct work_struct *w) } else { phylink_mac_pcs_get_state(pl, &link_state); - /* The PCS may have a latching link-fail indicator. - * If the link was up, bring the link down and - * re-trigger the resolve. Otherwise, re-read the - * PCS state to get the current status of the link. + /* The PCS may have a latching link-fail indicator. If the link + * was up, bring the link down and re-trigger the resolve. + * Otherwise, re-read the PCS state to get the current status + * of the link. */ if (!link_state.link) { if (cur_link_state) retrigger = true; else - phylink_mac_pcs_get_state(pl, - &link_state); + phylink_mac_pcs_get_state(pl, &link_state); } - /* If we have a phy, the "up" state is the union of - * both the PHY and the MAC + /* If we have a phy, the "up" state is the union of both the + * PHY and the MAC */ if (pl->phydev) link_state.link &= pl->phy_state.link; /* Only update if the PHY link is up */ if (pl->phydev && pl->phy_state.link) { - /* If the interface has changed, force a - * link down event if the link isn't already - * down, and re-resolve. + /* If the interface has changed, force a link down + * event if the link isn't already down, and re-resolve. */ - if (link_state.interface != - pl->phy_state.interface) { + if (link_state.interface != pl->phy_state.interface) { retrigger = true; link_state.link = false; } + link_state.interface = pl->phy_state.interface; - /* If we are doing rate matching, then the - * link speed/duplex comes from the PHY + /* If we are doing rate matching, then the link + * speed/duplex comes from the PHY */ if (pl->phy_state.rate_matching) { link_state.rate_matching = pl->phy_state.rate_matching; link_state.speed = pl->phy_state.speed; - link_state.duplex = - pl->phy_state.duplex; + link_state.duplex = pl->phy_state.duplex; } - /* If we have a PHY, we need to update with - * the PHY flow control bits. + /* If we have a PHY, we need to update with the PHY + * flow control bits. */ link_state.pause = pl->phy_state.pause; mac_config = true;