net: phy: marvell: Checkpatch - assignments and comparisons
authorAndrew Lunn <andrew@lunn.ch>
Wed, 17 May 2017 01:26:01 +0000 (03:26 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 May 2017 20:27:51 +0000 (16:27 -0400)
Avoid multiple assignments
Comparisons should place the constant on the right side of the test

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/marvell.c

index f52656ec618fe30d4b28c225e30ec4958e92287f..e9632f576a2442881e9bff9699f0aae7e161de64 100644 (file)
@@ -1101,7 +1101,7 @@ static int marvell_read_status_page(struct phy_device *phydev, int page)
        if (err)
                return err;
 
-       if (AUTONEG_ENABLE == phydev->autoneg) {
+       if (phydev->autoneg == AUTONEG_ENABLE) {
                status = phy_read(phydev, MII_M1011_PHY_STATUS);
                if (status < 0)
                        return status;
@@ -1126,7 +1126,8 @@ static int marvell_read_status_page(struct phy_device *phydev, int page)
                        phydev->duplex = DUPLEX_HALF;
 
                status = status & MII_M1011_PHY_STATUS_SPD_MASK;
-               phydev->pause = phydev->asym_pause = 0;
+               phydev->pause = 0;
+               phydev->asym_pause = 0;
 
                switch (status) {
                case MII_M1011_PHY_STATUS_1000:
@@ -1185,7 +1186,8 @@ static int marvell_read_status_page(struct phy_device *phydev, int page)
                else
                        phydev->speed = SPEED_10;
 
-               phydev->pause = phydev->asym_pause = 0;
+               phydev->pause = 0;
+               phydev->asym_pause = 0;
                phydev->lp_advertising = 0;
        }