]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
e1000e: Cleanup code logic in e1000_check_for_serdes_link_82571()
authorTushar Dave <tushar.n.dave@intel.com>
Thu, 12 Jul 2012 08:00:15 +0000 (08:00 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 14 Jul 2012 09:57:16 +0000 (02:57 -0700)
Cleanup code to make it more clean and readable.

Signed-off-by: Tushar Dave <tushar.n.dave@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/e1000e/82571.c

index 36db4df09aed6531cf66d893b40449a1b0cceb2c..19f4cb9582b56b4ccbe5b39c925c2b76951d0716 100644 (file)
@@ -1677,16 +1677,18 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
                        e_dbg("ANYSTATE  -> DOWN\n");
                } else {
                        /*
-                        * Check several times, if Sync and Config
-                        * both are consistently 1 then simply ignore
-                        * the Invalid bit and restart Autoneg
+                        * Check several times, if SYNCH bit and CONFIG
+                        * bit both are consistently 1 then simply ignore
+                        * the IV bit and restart Autoneg
                         */
                        for (i = 0; i < AN_RETRY_COUNT; i++) {
                                udelay(10);
                                rxcw = er32(RXCW);
-                               if ((rxcw & E1000_RXCW_IV) &&
-                                   !((rxcw & E1000_RXCW_SYNCH) &&
-                                     (rxcw & E1000_RXCW_C))) {
+                               if ((rxcw & E1000_RXCW_SYNCH) &&
+                                   (rxcw & E1000_RXCW_C))
+                                       continue;
+
+                               if (rxcw & E1000_RXCW_IV) {
                                        mac->serdes_has_link = false;
                                        mac->serdes_link_state =
                                            e1000_serdes_link_down;