netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH net-next 3/6] net: phy: marvell: Checkpatch - assignments and comparisons
Date: Wed, 17 May 2017 03:26:01 +0200	[thread overview]
Message-ID: <1494984364-19496-4-git-send-email-andrew@lunn.ch> (raw)
In-Reply-To: <1494984364-19496-1-git-send-email-andrew@lunn.ch>

Avoid multiple assignments
Comparisons should place the constant on the right side of the test

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/phy/marvell.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index f52656ec618f..e9632f576a24 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -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;
 	}
 
-- 
2.11.0

  parent reply	other threads:[~2017-05-17  1:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17  1:25 [PATCH net-next 0/6] net: phy: marvell: Checkpatch cleanup Andrew Lunn
2017-05-17  1:25 ` [PATCH net-next 1/6] net: phy: Marvell: checkpatch - Comments Andrew Lunn
2017-05-17  1:26 ` [PATCH net-next 2/6] net: phy: marvell: Checkpatch - Missing or extra blank lines Andrew Lunn
2017-05-17  1:26 ` Andrew Lunn [this message]
2017-05-17  1:26 ` [PATCH net-next 4/6] net: phy: marvell: Refactor some bigger functions Andrew Lunn
2017-05-17  1:26 ` [PATCH net-next 5/6] net: phy: marvell: Add helpers to get/set page Andrew Lunn
2017-05-17  1:26 ` [PATCH net-next 6/6] net: phy: marvell: checkpatch - Fix remaining long lines Andrew Lunn
2017-05-17 20:28 ` [PATCH net-next 0/6] net: phy: marvell: Checkpatch cleanup David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494984364-19496-4-git-send-email-andrew@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).