diff options
author | Patrick Kelle <patrick.kelle81@gmail.com> | 2011-12-01 12:54:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-01 12:54:46 -0500 |
commit | d7d75960ea74e524d75ba8b067523471f39a7bf3 (patch) | |
tree | f740896af0ebbc67c4fdb4b7aa294823dae86db2 /drivers/net/ethernet/icplus | |
parent | b536db9332cf90c4f44ca809f028645205fa89ad (diff) |
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.
As suggested by David Miller:
"You can simply this even further since p[7] is what is used here,
and this means len is one, the inner loop therefore executes only
once, and the p[7].field value is not used (it's zero in the table)
and the write to it is completely thrown away."
Signed-off-by: Patrick Kelle <patrick.kelle81@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/icplus')
-rw-r--r-- | drivers/net/ethernet/icplus/ipg.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/ethernet/icplus/ipg.c b/drivers/net/ethernet/icplus/ipg.c index 8fd80a00b898..075451d0207d 100644 --- a/drivers/net/ethernet/icplus/ipg.c +++ b/drivers/net/ethernet/icplus/ipg.c | |||
@@ -371,16 +371,9 @@ static void mdio_write(struct net_device *dev, int phy_id, int phy_reg, int val) | |||
371 | } | 371 | } |
372 | 372 | ||
373 | /* The last cycle is a tri-state, so read from the PHY. */ | 373 | /* The last cycle is a tri-state, so read from the PHY. */ |
374 | for (j = 7; j < 8; j++) { | 374 | ipg_write_phy_ctl(ioaddr, IPG_PC_MGMTCLK_LO | polarity); |
375 | for (i = 0; i < p[j].len; i++) { | 375 | ipg_r8(PHY_CTRL); |
376 | ipg_write_phy_ctl(ioaddr, IPG_PC_MGMTCLK_LO | polarity); | 376 | ipg_write_phy_ctl(ioaddr, IPG_PC_MGMTCLK_HI | polarity); |
377 | |||
378 | p[j].field |= ((ipg_r8(PHY_CTRL) & | ||
379 | IPG_PC_MGMTDATA) >> 1) << (p[j].len - 1 - i); | ||
380 | |||
381 | ipg_write_phy_ctl(ioaddr, IPG_PC_MGMTCLK_HI | polarity); | ||
382 | } | ||
383 | } | ||
384 | } | 377 | } |
385 | 378 | ||
386 | static void ipg_set_led_mode(struct net_device *dev) | 379 | static void ipg_set_led_mode(struct net_device *dev) |