lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 24 Nov 2011 16:39:05 +0100
From:	Patrick Kelle <patrick.kelle81@...il.com>
To:	netdev@...r.kernel.org
Cc:	romieu@...zoreil.com, sorbica@...lus.com.tw,
	Patrick Kelle <patrick.kelle81@...il.com>
Subject: [PATCH] icplus: mdio_write(), remove unnecessary for loop

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@...il.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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ