提交 dd93f95e 编写于 作者: B Bruce Allan 提交者: David S. Miller

e1000e: cleanup variables set but not used

The ICR register is clear on read and we don't care what the returned value
is when resetting the hardware so the icr variable(s) can be removed.  We
should not ignore the return from e1000_lv_jumbo_workaround_ich8lan() and
from e1000_get_phy_id_82571() (dump a debug message when it fails and when
an unknown Phy id is returned).
Signed-off-by: NBruce Allan <bruce.w.allan@intel.com>
Tested-by: NEmil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 03634668
...@@ -121,29 +121,36 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) ...@@ -121,29 +121,36 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
/* This can only be done after all function pointers are setup. */ /* This can only be done after all function pointers are setup. */
ret_val = e1000_get_phy_id_82571(hw); ret_val = e1000_get_phy_id_82571(hw);
if (ret_val) {
e_dbg("Error getting PHY ID\n");
return ret_val;
}
/* Verify phy id */ /* Verify phy id */
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_82571: case e1000_82571:
case e1000_82572: case e1000_82572:
if (phy->id != IGP01E1000_I_PHY_ID) if (phy->id != IGP01E1000_I_PHY_ID)
return -E1000_ERR_PHY; ret_val = -E1000_ERR_PHY;
break; break;
case e1000_82573: case e1000_82573:
if (phy->id != M88E1111_I_PHY_ID) if (phy->id != M88E1111_I_PHY_ID)
return -E1000_ERR_PHY; ret_val = -E1000_ERR_PHY;
break; break;
case e1000_82574: case e1000_82574:
case e1000_82583: case e1000_82583:
if (phy->id != BME1000_E_PHY_ID_R2) if (phy->id != BME1000_E_PHY_ID_R2)
return -E1000_ERR_PHY; ret_val = -E1000_ERR_PHY;
break; break;
default: default:
return -E1000_ERR_PHY; ret_val = -E1000_ERR_PHY;
break; break;
} }
return 0; if (ret_val)
e_dbg("PHY ID unknown: type = 0x%08x\n", phy->id);
return ret_val;
} }
/** /**
...@@ -956,7 +963,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active) ...@@ -956,7 +963,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
**/ **/
static s32 e1000_reset_hw_82571(struct e1000_hw *hw) static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
{ {
u32 ctrl, ctrl_ext, icr; u32 ctrl, ctrl_ext;
s32 ret_val; s32 ret_val;
/* /*
...@@ -1040,7 +1047,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) ...@@ -1040,7 +1047,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
/* Clear any pending interrupt events. */ /* Clear any pending interrupt events. */
ew32(IMC, 0xffffffff); ew32(IMC, 0xffffffff);
icr = er32(ICR); er32(ICR);
if (hw->mac.type == e1000_82571) { if (hw->mac.type == e1000_82571) {
/* Install any alternate MAC address into RAR0 */ /* Install any alternate MAC address into RAR0 */
......
...@@ -784,7 +784,7 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed, ...@@ -784,7 +784,7 @@ static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
**/ **/
static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw) static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
{ {
u32 ctrl, icr; u32 ctrl;
s32 ret_val; s32 ret_val;
/* /*
...@@ -818,7 +818,7 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw) ...@@ -818,7 +818,7 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
/* Clear any pending interrupt events. */ /* Clear any pending interrupt events. */
ew32(IMC, 0xffffffff); ew32(IMC, 0xffffffff);
icr = er32(ICR); er32(ICR);
ret_val = e1000_check_alt_mac_addr_generic(hw); ret_val = e1000_check_alt_mac_addr_generic(hw);
......
...@@ -2977,7 +2977,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) ...@@ -2977,7 +2977,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
{ {
struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
u16 reg; u16 reg;
u32 ctrl, icr, kab; u32 ctrl, kab;
s32 ret_val; s32 ret_val;
/* /*
...@@ -3067,7 +3067,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) ...@@ -3067,7 +3067,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
ew32(CRC_OFFSET, 0x65656565); ew32(CRC_OFFSET, 0x65656565);
ew32(IMC, 0xffffffff); ew32(IMC, 0xffffffff);
icr = er32(ICR); er32(ICR);
kab = er32(KABGTXD); kab = er32(KABGTXD);
kab |= E1000_KABGTXD_BGSQLBIAS; kab |= E1000_KABGTXD_BGSQLBIAS;
......
...@@ -2734,6 +2734,9 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) ...@@ -2734,6 +2734,9 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);
else else
ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);
if (ret_val)
e_dbg("failed to enable jumbo frame workaround mode\n");
} }
/* Program MC offset vector base */ /* Program MC offset vector base */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册