netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: phy: Log only PHY state transitions
@ 2017-07-25  9:31 Marc Gonzalez
  2017-07-25 19:33 ` David Miller
  2017-07-28 11:18 ` [PATCH v2] " Marc Gonzalez
  0 siblings, 2 replies; 5+ messages in thread
From: Marc Gonzalez @ 2017-07-25  9:31 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli; +Cc: netdev, Mason

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>
---
 drivers/net/phy/phy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index d0626bf5c540..6bb764e716fc 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1226,7 +1226,8 @@ void phy_state_machine(struct work_struct *work)
 	if (err < 0)
 		phy_error(phydev);
 
-	phydev_dbg(phydev, "PHY state change %s -> %s\n",
+	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));
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-31 23:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-25  9:31 [PATCH] net: phy: Log only PHY state transitions Marc Gonzalez
2017-07-25 19:33 ` David Miller
2017-07-26 17:24   ` Florian Fainelli
2017-07-28 11:18 ` [PATCH v2] " Marc Gonzalez
2017-07-31 23:21   ` David Miller

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).