Skip to contentSkip to conversation

Remove unnecessary condition check in phy

PATCH In review Balakumaran Kannan 3 participants 5 messages Apr 5, 2014 – Apr 8, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove unnecessary condition check in phy

This condition check makes no difference in the code flow since 3.10

---
 drivers/net/phy/phy.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/phy/phy.c +1 -5
index 1d788f1..1b6d09a 100644
@@ -756,12 +756,8 @@ void phy_state_machine(struct work_struct *work)
            netif_carrier_on(phydev->attached_dev);
            phydev->adjust_link(phydev->attached_dev);
 
-       } else if (0 == phydev->link_timeout--) {
+       } else if (0 == phydev->link_timeout--)
            needs_aneg = 1;
-           /* If we have the magic_aneg bit, we try again */
-           if (phydev->drv->flags & PHY_HAS_MAGICANEG)
-               break;
-       }
        break;
    case PHY_NOLINK:
        err = phy_read_status(phydev);
Signature · 1 line
1.7.9.5
Reviewed-by
#2 lore raw

2014-04-07 11:58 GMT-07:00 David Miller <[email protected]>:

Quoted 8 lines

From: Balakumaran Kannan <[email protected]>
Date: Sat, 05 Apr 2014 13:00:16 +0530

Quoted 3 lines

This condition check makes no difference in the code flow since 3.10

The big questions is, was this intentional?

It was before a33e6112d9b0 ("phy: Elimination the forced speed reduction algorithm") because the PHY having PHY_HAS_MAGICANEG set would not go through the PHY speed reduction algorithm. Now, this is useless as there is a subsequent break and no conditional code based on PHY_HAS_MAGICANEG (which means that we should also kill its usage at some point).

Feel free to add my reviewed-by tag after fixing the mangling David spotted.

Signature · 1 line
Florian
maintainer
#3 lore raw

From: Florian Fainelli <[email protected]>
Date: Mon, 7 Apr 2014 18:09:00 -0700

Quoted 8 lines

2014-04-07 11:58 GMT-07:00 David Miller <[email protected]>:

Quoted 7 lines

From: Balakumaran Kannan <[email protected]>
Date: Sat, 05 Apr 2014 13:00:16 +0530

Quoted 3 lines

This condition check makes no difference in the code flow since 3.10

Quoted 8 lines
Quoted 1 line

The big questions is, was this intentional?

It was before a33e6112d9b0 ("phy: Elimination the forced speed reduction algorithm") because the PHY having PHY_HAS_MAGICANEG set would not go through the PHY speed reduction algorithm. Now, this is useless as there is a subsequent break and no conditional code based on PHY_HAS_MAGICANEG (which means that we should also kill its usage at some point).

Yep, I read through the history and that's why I noticed the patch didn't apply, I was about to apply it :-)

Quoted 3 lines

Feel free to add my reviewed-by tag after fixing the mangling David spotted.

Will do, thanks Florian.

maintainer
#4 lore raw
In reply to Balakumaran Kannan

From: Balakumaran Kannan <[email protected]>
Date: Sat, 05 Apr 2014 13:00:16 +0530

Quoted 3 lines

This condition check makes no difference in the code flow since 3.10

This patch doesn't apply cleanly to the current tree.

It's because your email client corrupted the patch, changing TAB characters into spaces amongst other things.

Also your subject line is not properly formed. It should state the subsystem after the closing bracket, followed by ": " then the top-level description of your change.