mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: peppe.cavallaro@st.com, alexandre.torgue@st.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Corentin Labbe <clabbe.montjoie@gmail.com>
Subject: [PATCH 8/8] net: stmmac: invert the logic for dumping regs
Date: Tue, 14 Feb 2017 20:54:41 +0100	[thread overview]
Message-ID: <20170214195441.30425-9-clabbe.montjoie@gmail.com> (raw)
In-Reply-To: <20170214195441.30425-1-clabbe.montjoie@gmail.com>

It is easier to follow the logic by removing the not operator

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index aab895d..5ff6bc4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -442,24 +442,24 @@ static void stmmac_ethtool_gregs(struct net_device *dev,
 
 	memset(reg_space, 0x0, REG_SPACE_SIZE);
 
-	if (!(priv->plat->has_gmac || priv->plat->has_gmac4)) {
+	if (priv->plat->has_gmac || priv->plat->has_gmac4) {
 		/* MAC registers */
-		for (i = 0; i < 12; i++)
+		for (i = 0; i < 55; i++)
 			reg_space[i] = readl(priv->ioaddr + (i * 4));
 		/* DMA registers */
-		for (i = 0; i < 9; i++)
-			reg_space[i + 12] =
+		for (i = 0; i < 22; i++)
+			reg_space[i + 55] =
 			    readl(priv->ioaddr + (DMA_BUS_MODE + (i * 4)));
-		reg_space[22] = readl(priv->ioaddr + DMA_CUR_TX_BUF_ADDR);
-		reg_space[23] = readl(priv->ioaddr + DMA_CUR_RX_BUF_ADDR);
 	} else {
 		/* MAC registers */
-		for (i = 0; i < 55; i++)
+		for (i = 0; i < 12; i++)
 			reg_space[i] = readl(priv->ioaddr + (i * 4));
 		/* DMA registers */
-		for (i = 0; i < 22; i++)
-			reg_space[i + 55] =
+		for (i = 0; i < 9; i++)
+			reg_space[i + 12] =
 			    readl(priv->ioaddr + (DMA_BUS_MODE + (i * 4)));
+		reg_space[22] = readl(priv->ioaddr + DMA_CUR_TX_BUF_ADDR);
+		reg_space[23] = readl(priv->ioaddr + DMA_CUR_RX_BUF_ADDR);
 	}
 }
 
-- 
2.10.2

  parent reply	other threads:[~2017-02-14 20:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 19:54 [PATCH 0/8] net: stmmac: misc patchs Corentin Labbe
2017-02-14 19:54 ` [PATCH 1/8] net: stmmac: remove useless parenthesis Corentin Labbe
2017-02-14 19:54 ` [PATCH 2/8] net: stmmac: likely is useless in occasional function Corentin Labbe
2017-02-14 19:54 ` [PATCH 3/8] net: stmmac: use SPEED_UNKNOWN/DUPLEX_UNKNOWN Corentin Labbe
2017-02-14 19:54 ` [PATCH 4/8] net: stmmac: set speed at SPEED_UNKNOWN in case of broken speed Corentin Labbe
2017-02-14 19:54 ` [PATCH 5/8] net: stmmac: run stmmac_hw_fix_mac_speed when speed is valid Corentin Labbe
2017-02-14 19:54 ` [PATCH 6/8] net: stmmac: split the stmmac_adjust_link 10/100 case Corentin Labbe
2017-02-14 19:54 ` [PATCH 7/8] net: stmmac: reduce indentation by adding a continue Corentin Labbe
2017-02-14 19:54 ` Corentin Labbe [this message]
2017-02-15  6:34 ` [PATCH 0/8] net: stmmac: misc patchs Giuseppe CAVALLARO
2017-02-15  7:39   ` Corentin Labbe
2017-02-15  9:11     ` Giuseppe CAVALLARO

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=20170214195441.30425-9-clabbe.montjoie@gmail.com \
    --to=clabbe.montjoie@gmail.com \
    --cc=alexandre.torgue@st.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /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

all inboxes | Powered by JetHome®