mirror of
https://github.com/ipxe/ipxe
synced 2025-12-31 06:49:20 +03:00
[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:
@@ -271,7 +271,7 @@ void e1000_init_function_pointers_82540(struct e1000_hw *hw)
|
||||
**/
|
||||
static s32 e1000_reset_hw_82540(struct e1000_hw *hw)
|
||||
{
|
||||
u32 ctrl, icr, manc;
|
||||
u32 ctrl, manc;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
|
||||
DEBUGFUNC("e1000_reset_hw_82540");
|
||||
@@ -316,7 +316,7 @@ static s32 e1000_reset_hw_82540(struct e1000_hw *hw)
|
||||
E1000_WRITE_REG(hw, E1000_MANC, manc);
|
||||
|
||||
E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
|
||||
icr = E1000_READ_REG(hw, E1000_ICR);
|
||||
E1000_READ_REG(hw, E1000_ICR);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ void e1000_init_function_pointers_82541(struct e1000_hw *hw)
|
||||
**/
|
||||
static s32 e1000_reset_hw_82541(struct e1000_hw *hw)
|
||||
{
|
||||
u32 ledctl, ctrl, icr, manc;
|
||||
u32 ledctl, ctrl, manc;
|
||||
|
||||
DEBUGFUNC("e1000_reset_hw_82541");
|
||||
|
||||
@@ -368,7 +368,7 @@ static s32 e1000_reset_hw_82541(struct e1000_hw *hw)
|
||||
E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF);
|
||||
|
||||
/* Clear any pending interrupt events. */
|
||||
icr = E1000_READ_REG(hw, E1000_ICR);
|
||||
E1000_READ_REG(hw, E1000_ICR);
|
||||
|
||||
return E1000_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ static s32 e1000_reset_hw_82542(struct e1000_hw *hw)
|
||||
{
|
||||
struct e1000_bus_info *bus = &hw->bus;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
u32 ctrl, icr;
|
||||
u32 ctrl;
|
||||
|
||||
DEBUGFUNC("e1000_reset_hw_82542");
|
||||
|
||||
@@ -217,7 +217,7 @@ static s32 e1000_reset_hw_82542(struct e1000_hw *hw)
|
||||
msec_delay(2);
|
||||
|
||||
E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
|
||||
icr = E1000_READ_REG(hw, E1000_ICR);
|
||||
E1000_READ_REG(hw, E1000_ICR);
|
||||
|
||||
if (hw->revision_id == E1000_REVISION_2) {
|
||||
if (bus->pci_cmd_word & CMD_MEM_WRT_INVALIDATE)
|
||||
|
||||
@@ -907,7 +907,7 @@ static s32 e1000_phy_hw_reset_82543(struct e1000_hw *hw)
|
||||
**/
|
||||
static s32 e1000_reset_hw_82543(struct e1000_hw *hw)
|
||||
{
|
||||
u32 ctrl, icr;
|
||||
u32 ctrl;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
|
||||
DEBUGFUNC("e1000_reset_hw_82543");
|
||||
@@ -949,7 +949,7 @@ static s32 e1000_reset_hw_82543(struct e1000_hw *hw)
|
||||
|
||||
/* Masking off and clearing any pending interrupts */
|
||||
E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
|
||||
icr = E1000_READ_REG(hw, E1000_ICR);
|
||||
E1000_READ_REG(hw, E1000_ICR);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
@@ -554,14 +554,12 @@ static void e1000_close ( struct net_device *netdev )
|
||||
struct e1000_adapter *adapter = netdev_priv ( netdev );
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
uint32_t rctl;
|
||||
uint32_t icr;
|
||||
|
||||
DBG ( "e1000_close\n" );
|
||||
|
||||
/* Acknowledge interrupts */
|
||||
icr = E1000_READ_REG ( hw, E1000_ICR );
|
||||
|
||||
/* Disable and acknowledge interrupts */
|
||||
e1000_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