[e1000] Remove unused variable when ICR register is simply cleared
On reset and close, the ICR register is read to clear any pending interrupts, but the value is simply ignored. Avoid assigning the value to a variable, to inhibit a warning from gcc 4.6. Also fix a potential race condition in reset routines which clear interrupts before disabling them. Reported-by: Ralph Giles <giles@thaumas.net> Tested-by: Ralph Giles <giles@thaumas.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -841,7 +841,7 @@ static s32 e1000e_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
|
||||
**/
|
||||
static s32 e1000e_reset_hw_80003es2lan(struct e1000_hw *hw)
|
||||
{
|
||||
u32 ctrl, icr;
|
||||
u32 ctrl;
|
||||
s32 ret_val;
|
||||
|
||||
/*
|
||||
@@ -875,7 +875,7 @@ static s32 e1000e_reset_hw_80003es2lan(struct e1000_hw *hw)
|
||||
|
||||
/* Clear any pending interrupt events. */
|
||||
ew32(IMC, 0xffffffff);
|
||||
icr = er32(ICR);
|
||||
er32(ICR);
|
||||
|
||||
ret_val = e1000e_check_alt_mac_addr_generic(hw);
|
||||
|
||||
|
||||
@@ -919,7 +919,7 @@ out:
|
||||
**/
|
||||
static s32 e1000e_reset_hw_82571(struct e1000_hw *hw)
|
||||
{
|
||||
u32 ctrl, extcnf_ctrl, ctrl_ext, icr;
|
||||
u32 ctrl, extcnf_ctrl, ctrl_ext;
|
||||
s32 ret_val;
|
||||
u16 i = 0;
|
||||
|
||||
@@ -1004,7 +1004,7 @@ static s32 e1000e_reset_hw_82571(struct e1000_hw *hw)
|
||||
|
||||
/* Clear any pending interrupt events. */
|
||||
ew32(IMC, 0xffffffff);
|
||||
icr = er32(ICR);
|
||||
er32(ICR);
|
||||
|
||||
/* Install any alternate MAC address into RAR0 */
|
||||
ret_val = e1000e_check_alt_mac_addr_generic(hw);
|
||||
|
||||
@@ -2486,7 +2486,7 @@ static s32 e1000e_reset_hw_ich8lan(struct e1000_hw *hw)
|
||||
{
|
||||
struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
|
||||
u16 reg;
|
||||
u32 ctrl, icr, kab;
|
||||
u32 ctrl, kab;
|
||||
s32 ret_val;
|
||||
|
||||
/*
|
||||
@@ -2594,7 +2594,7 @@ static s32 e1000e_reset_hw_ich8lan(struct e1000_hw *hw)
|
||||
ew32(CRC_OFFSET, 0x65656565);
|
||||
|
||||
ew32(IMC, 0xffffffff);
|
||||
icr = er32(ICR);
|
||||
er32(ICR);
|
||||
|
||||
kab = er32(KABGTXD);
|
||||
kab |= E1000_KABGTXD_BGSQLBIAS;
|
||||
|
||||
@@ -873,14 +873,12 @@ static void e1000e_close ( struct net_device *netdev )
|
||||
struct e1000_adapter *adapter = netdev_priv ( netdev );
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
uint32_t rctl;
|
||||
uint32_t icr;
|
||||
|
||||
DBGP ( "e1000_close\n" );
|
||||
|
||||
/* Acknowledge interrupts */
|
||||
icr = E1000_READ_REG ( hw, E1000_ICR );
|
||||
|
||||
/* Disable and acknowledge interrupts */
|
||||
e1000e_irq_disable ( adapter );
|
||||
E1000_READ_REG ( hw, E1000_ICR );
|
||||
|
||||
/* disable receives */
|
||||
rctl = E1000_READ_REG ( hw, E1000_RCTL );
|
||||
|
||||
Reference in New Issue
Block a user