From: Patrick Kelle <patrick.kelle81@gmail.com>
To: netdev@vger.kernel.org
Cc: romieu@fr.zoreil.com, sorbica@icplus.com.tw,
	Patrick Kelle <patrick.kelle81@gmail.com>
Subject: [PATCH] icplus: mdio_write(), remove unnecessary for loop
Date: Thu, 24 Nov 2011 16:39:05 +0100	[thread overview]
Message-ID: <1322149145-32242-1-git-send-email-patrick.kelle81@gmail.com> (raw)
At this point the variable j is always set to 7 and the code within
the loop has to run only once anyway.
Signed-off-by: Patrick Kelle <patrick.kelle81@gmail.com>
---
 drivers/net/ethernet/icplus/ipg.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/icplus/ipg.c b/drivers/net/ethernet/icplus/ipg.c
index 8fd80a0..a65d747 100644
--- a/drivers/net/ethernet/icplus/ipg.c
+++ b/drivers/net/ethernet/icplus/ipg.c
@@ -371,15 +371,13 @@ static void mdio_write(struct net_device *dev, int phy_id, int phy_reg, int val)
 	}
 
 	/* The last cycle is a tri-state, so read from the PHY. */
-	for (j = 7; j < 8; j++) {
-		for (i = 0; i < p[j].len; i++) {
-			ipg_write_phy_ctl(ioaddr, IPG_PC_MGMTCLK_LO | polarity);
+	for (i = 0; i < p[j].len; i++) {
+		ipg_write_phy_ctl(ioaddr, IPG_PC_MGMTCLK_LO | polarity);
 
-			p[j].field |= ((ipg_r8(PHY_CTRL) &
-				IPG_PC_MGMTDATA) >> 1) << (p[j].len - 1 - i);
+		p[j].field |= ((ipg_r8(PHY_CTRL) &
+			IPG_PC_MGMTDATA) >> 1) << (p[j].len - 1 - i);
 
-			ipg_write_phy_ctl(ioaddr, IPG_PC_MGMTCLK_HI | polarity);
-		}
+		ipg_write_phy_ctl(ioaddr, IPG_PC_MGMTCLK_HI | polarity);
 	}
 }
 
-- 
1.7.7.1
next             reply	other threads:[~2011-11-24 15:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-24 15:39 Patrick Kelle [this message]
2011-11-29 23:47 ` [PATCH] icplus: mdio_write(), remove unnecessary for loop 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=1322149145-32242-1-git-send-email-patrick.kelle81@gmail.com \
    --to=patrick.kelle81@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=romieu@fr.zoreil.com \
    --cc=sorbica@icplus.com.tw \
    /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).