diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2009-11-20 18:27:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-21 14:34:21 -0500 |
commit | 99673d9b5d48c81f2e9fe094c0d9e42815c60b3f (patch) | |
tree | e21e8f5149bb8a08497d97c3f0691dc81dbf2ac3 /drivers/net/e1000e | |
parent | 3d5e33c9783d3e911e9aef0339663e887044f0df (diff) |
e1000e: cleanup functions that clear hardware statistics
The e1000_clear_hw_cntrs_*() functions read the registers to clear them.
There is no reason to save the register contents so the temp variable can
be removed.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000e')
-rw-r--r-- | drivers/net/e1000e/82571.c | 70 | ||||
-rw-r--r-- | drivers/net/e1000e/es2lan.c | 70 | ||||
-rw-r--r-- | drivers/net/e1000e/ich8lan.c | 23 | ||||
-rw-r--r-- | drivers/net/e1000e/lib.c | 76 |
4 files changed, 116 insertions, 123 deletions
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c index 468dd7d4fcad..c5dc1b3be230 100644 --- a/drivers/net/e1000e/82571.c +++ b/drivers/net/e1000e/82571.c | |||
@@ -1613,44 +1613,42 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) | |||
1613 | **/ | 1613 | **/ |
1614 | static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw) | 1614 | static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw) |
1615 | { | 1615 | { |
1616 | u32 temp; | ||
1617 | |||
1618 | e1000e_clear_hw_cntrs_base(hw); | 1616 | e1000e_clear_hw_cntrs_base(hw); |
1619 | 1617 | ||
1620 | temp = er32(PRC64); | 1618 | er32(PRC64); |
1621 | temp = er32(PRC127); | 1619 | er32(PRC127); |
1622 | temp = er32(PRC255); | 1620 | er32(PRC255); |
1623 | temp = er32(PRC511); | 1621 | er32(PRC511); |
1624 | temp = er32(PRC1023); | 1622 | er32(PRC1023); |
1625 | temp = er32(PRC1522); | 1623 | er32(PRC1522); |
1626 | temp = er32(PTC64); | 1624 | er32(PTC64); |
1627 | temp = er32(PTC127); | 1625 | er32(PTC127); |
1628 | temp = er32(PTC255); | 1626 | er32(PTC255); |
1629 | temp = er32(PTC511); | 1627 | er32(PTC511); |
1630 | temp = er32(PTC1023); | 1628 | er32(PTC1023); |
1631 | temp = er32(PTC1522); | 1629 | er32(PTC1522); |
1632 | 1630 | ||
1633 | temp = er32(ALGNERRC); | 1631 | er32(ALGNERRC); |
1634 | temp = er32(RXERRC); | 1632 | er32(RXERRC); |
1635 | temp = er32(TNCRS); | 1633 | er32(TNCRS); |
1636 | temp = er32(CEXTERR); | 1634 | er32(CEXTERR); |
1637 | temp = er32(TSCTC); | 1635 | er32(TSCTC); |
1638 | temp = er32(TSCTFC); | 1636 | er32(TSCTFC); |
1639 | 1637 | ||
1640 | temp = er32(MGTPRC); | 1638 | er32(MGTPRC); |
1641 | temp = er32(MGTPDC); | 1639 | er32(MGTPDC); |
1642 | temp = er32(MGTPTC); | 1640 | er32(MGTPTC); |
1643 | 1641 | ||
1644 | temp = er32(IAC); | 1642 | er32(IAC); |
1645 | temp = er32(ICRXOC); | 1643 | er32(ICRXOC); |
1646 | 1644 | ||
1647 | temp = er32(ICRXPTC); | 1645 | er32(ICRXPTC); |
1648 | temp = er32(ICRXATC); | 1646 | er32(ICRXATC); |
1649 | temp = er32(ICTXPTC); | 1647 | er32(ICTXPTC); |
1650 | temp = er32(ICTXATC); | 1648 | er32(ICTXATC); |
1651 | temp = er32(ICTXQEC); | 1649 | er32(ICTXQEC); |
1652 | temp = er32(ICTXQMTC); | 1650 | er32(ICTXQMTC); |
1653 | temp = er32(ICRXDMTC); | 1651 | er32(ICRXDMTC); |
1654 | } | 1652 | } |
1655 | 1653 | ||
1656 | static struct e1000_mac_operations e82571_mac_ops = { | 1654 | static struct e1000_mac_operations e82571_mac_ops = { |
diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c index 795d433e656f..8a089569c6e1 100644 --- a/drivers/net/e1000e/es2lan.c +++ b/drivers/net/e1000e/es2lan.c | |||
@@ -1304,44 +1304,42 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, | |||
1304 | **/ | 1304 | **/ |
1305 | static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw) | 1305 | static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw) |
1306 | { | 1306 | { |
1307 | u32 temp; | ||
1308 | |||
1309 | e1000e_clear_hw_cntrs_base(hw); | 1307 | e1000e_clear_hw_cntrs_base(hw); |
1310 | 1308 | ||
1311 | temp = er32(PRC64); | 1309 | er32(PRC64); |
1312 | temp = er32(PRC127); | 1310 | er32(PRC127); |
1313 | temp = er32(PRC255); | 1311 | er32(PRC255); |
1314 | temp = er32(PRC511); | 1312 | er32(PRC511); |
1315 | temp = er32(PRC1023); | 1313 | er32(PRC1023); |
1316 | temp = er32(PRC1522); | 1314 | er32(PRC1522); |
1317 | temp = er32(PTC64); | 1315 | er32(PTC64); |
1318 | temp = er32(PTC127); | 1316 | er32(PTC127); |
1319 | temp = er32(PTC255); | 1317 | er32(PTC255); |
1320 | temp = er32(PTC511); | 1318 | er32(PTC511); |
1321 | temp = er32(PTC1023); | 1319 | er32(PTC1023); |
1322 | temp = er32(PTC1522); | 1320 | er32(PTC1522); |
1323 | 1321 | ||
1324 | temp = er32(ALGNERRC); | 1322 | er32(ALGNERRC); |
1325 | temp = er32(RXERRC); | 1323 | er32(RXERRC); |
1326 | temp = er32(TNCRS); | 1324 | er32(TNCRS); |
1327 | temp = er32(CEXTERR); | 1325 | er32(CEXTERR); |
1328 | temp = er32(TSCTC); | 1326 | er32(TSCTC); |
1329 | temp = er32(TSCTFC); | 1327 | er32(TSCTFC); |
1330 | 1328 | ||
1331 | temp = er32(MGTPRC); | 1329 | er32(MGTPRC); |
1332 | temp = er32(MGTPDC); | 1330 | er32(MGTPDC); |
1333 | temp = er32(MGTPTC); | 1331 | er32(MGTPTC); |
1334 | 1332 | ||
1335 | temp = er32(IAC); | 1333 | er32(IAC); |
1336 | temp = er32(ICRXOC); | 1334 | er32(ICRXOC); |
1337 | 1335 | ||
1338 | temp = er32(ICRXPTC); | 1336 | er32(ICRXPTC); |
1339 | temp = er32(ICRXATC); | 1337 | er32(ICRXATC); |
1340 | temp = er32(ICTXPTC); | 1338 | er32(ICTXPTC); |
1341 | temp = er32(ICTXATC); | 1339 | er32(ICTXATC); |
1342 | temp = er32(ICTXQEC); | 1340 | er32(ICTXQEC); |
1343 | temp = er32(ICTXQMTC); | 1341 | er32(ICTXQMTC); |
1344 | temp = er32(ICRXDMTC); | 1342 | er32(ICRXDMTC); |
1345 | } | 1343 | } |
1346 | 1344 | ||
1347 | static struct e1000_mac_operations es2_mac_ops = { | 1345 | static struct e1000_mac_operations es2_mac_ops = { |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index f8ee0f29d237..2c1d08e04436 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -3402,24 +3402,23 @@ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw) | |||
3402 | **/ | 3402 | **/ |
3403 | static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw) | 3403 | static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw) |
3404 | { | 3404 | { |
3405 | u32 temp; | ||
3406 | u16 phy_data; | 3405 | u16 phy_data; |
3407 | 3406 | ||
3408 | e1000e_clear_hw_cntrs_base(hw); | 3407 | e1000e_clear_hw_cntrs_base(hw); |
3409 | 3408 | ||
3410 | temp = er32(ALGNERRC); | 3409 | er32(ALGNERRC); |
3411 | temp = er32(RXERRC); | 3410 | er32(RXERRC); |
3412 | temp = er32(TNCRS); | 3411 | er32(TNCRS); |
3413 | temp = er32(CEXTERR); | 3412 | er32(CEXTERR); |
3414 | temp = er32(TSCTC); | 3413 | er32(TSCTC); |
3415 | temp = er32(TSCTFC); | 3414 | er32(TSCTFC); |
3416 | 3415 | ||
3417 | temp = er32(MGTPRC); | 3416 | er32(MGTPRC); |
3418 | temp = er32(MGTPDC); | 3417 | er32(MGTPDC); |
3419 | temp = er32(MGTPTC); | 3418 | er32(MGTPTC); |
3420 | 3419 | ||
3421 | temp = er32(IAC); | 3420 | er32(IAC); |
3422 | temp = er32(ICRXOC); | 3421 | er32(ICRXOC); |
3423 | 3422 | ||
3424 | /* Clear PHY statistics registers */ | 3423 | /* Clear PHY statistics registers */ |
3425 | if ((hw->phy.type == e1000_phy_82578) || | 3424 | if ((hw->phy.type == e1000_phy_82578) || |
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c index d173bf88cc94..f690a1055b41 100644 --- a/drivers/net/e1000e/lib.c +++ b/drivers/net/e1000e/lib.c | |||
@@ -295,45 +295,43 @@ void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw, | |||
295 | **/ | 295 | **/ |
296 | void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw) | 296 | void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw) |
297 | { | 297 | { |
298 | u32 temp; | 298 | er32(CRCERRS); |
299 | 299 | er32(SYMERRS); | |
300 | temp = er32(CRCERRS); | 300 | er32(MPC); |
301 | temp = er32(SYMERRS); | 301 | er32(SCC); |
302 | temp = er32(MPC); | 302 | er32(ECOL); |
303 | temp = er32(SCC); | 303 | er32(MCC); |
304 | temp = er32(ECOL); | 304 | er32(LATECOL); |
305 | temp = er32(MCC); | 305 | er32(COLC); |
306 | temp = er32(LATECOL); | 306 | er32(DC); |
307 | temp = er32(COLC); | 307 | er32(SEC); |
308 | temp = er32(DC); | 308 | er32(RLEC); |
309 | temp = er32(SEC); | 309 | er32(XONRXC); |
310 | temp = er32(RLEC); | 310 | er32(XONTXC); |
311 | temp = er32(XONRXC); | 311 | er32(XOFFRXC); |
312 | temp = er32(XONTXC); | 312 | er32(XOFFTXC); |
313 | temp = er32(XOFFRXC); | 313 | er32(FCRUC); |
314 | temp = er32(XOFFTXC); | 314 | er32(GPRC); |
315 | temp = er32(FCRUC); | 315 | er32(BPRC); |
316 | temp = er32(GPRC); | 316 | er32(MPRC); |
317 | temp = er32(BPRC); | 317 | er32(GPTC); |
318 | temp = er32(MPRC); | 318 | er32(GORCL); |
319 | temp = er32(GPTC); | 319 | er32(GORCH); |
320 | temp = er32(GORCL); | 320 | er32(GOTCL); |
321 | temp = er32(GORCH); | 321 | er32(GOTCH); |
322 | temp = er32(GOTCL); | 322 | er32(RNBC); |
323 | temp = er32(GOTCH); | 323 | er32(RUC); |
324 | temp = er32(RNBC); | 324 | er32(RFC); |
325 | temp = er32(RUC); | 325 | er32(ROC); |
326 | temp = er32(RFC); | 326 | er32(RJC); |
327 | temp = er32(ROC); | 327 | er32(TORL); |
328 | temp = er32(RJC); | 328 | er32(TORH); |
329 | temp = er32(TORL); | 329 | er32(TOTL); |
330 | temp = er32(TORH); | 330 | er32(TOTH); |
331 | temp = er32(TOTL); | 331 | er32(TPR); |
332 | temp = er32(TOTH); | 332 | er32(TPT); |
333 | temp = er32(TPR); | 333 | er32(MPTC); |
334 | temp = er32(TPT); | 334 | er32(BPTC); |
335 | temp = er32(MPTC); | ||
336 | temp = er32(BPTC); | ||
337 | } | 335 | } |
338 | 336 | ||
339 | /** | 337 | /** |