Message ID | 7a34bf57-4fde-529f-36cf-ad8022185df9@sigmadesigns.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Marc Gonzalez <marc_gonzalez@sigmadesigns.com> Date: Fri, 28 Jul 2017 13:18:30 +0200 > In the current code, old and new PHY states are always logged. > From now on, log only PHY state transitions. > > Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com> Applied to net-next, thanks.
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index d0626bf5c540..3ff79c3d90f0 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -1226,9 +1226,10 @@ void phy_state_machine(struct work_struct *work) if (err < 0) phy_error(phydev); - phydev_dbg(phydev, "PHY state change %s -> %s\n", - phy_state_to_str(old_state), - phy_state_to_str(phydev->state)); + if (old_state != phydev->state) + phydev_dbg(phydev, "PHY state change %s -> %s\n", + phy_state_to_str(old_state), + phy_state_to_str(phydev->state)); /* Only re-schedule a PHY state machine change if we are polling the * PHY, if PHY_IGNORE_INTERRUPT is set, then we will be moving
In the current code, old and new PHY states are always logged. From now on, log only PHY state transitions. Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com> --- Fix indentation. I was trying to minimize the diff. I also considered using a goto to jump over the phydev_dbg() call, but that didn't feel right. --- drivers/net/phy/phy.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)