[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:
@@ -959,7 +959,7 @@ void igb_shutdown_serdes_link_82575(struct e1000_hw *hw)
|
||||
**/
|
||||
static s32 igb_reset_hw_82575(struct e1000_hw *hw)
|
||||
{
|
||||
u32 ctrl, icr;
|
||||
u32 ctrl;
|
||||
s32 ret_val;
|
||||
|
||||
DEBUGFUNC("igb_reset_hw_82575");
|
||||
@@ -1009,7 +1009,7 @@ static s32 igb_reset_hw_82575(struct e1000_hw *hw)
|
||||
|
||||
/* Clear any pending interrupt events. */
|
||||
E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
|
||||
icr = E1000_READ_REG(hw, E1000_ICR);
|
||||
E1000_READ_REG(hw, E1000_ICR);
|
||||
|
||||
/* Install any alternate MAC address into RAR0 */
|
||||
ret_val = igb_check_alt_mac_addr_generic(hw);
|
||||
|
||||
@@ -639,14 +639,12 @@ static void igb_close ( struct net_device *netdev )
|
||||
struct igb_adapter *adapter = netdev_priv ( netdev );
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
uint32_t rctl;
|
||||
uint32_t icr;
|
||||
|
||||
DBGP ( "igb_close\n" );
|
||||
|
||||
/* Acknowledge interrupts */
|
||||
icr = E1000_READ_REG ( hw, E1000_ICR );
|
||||
|
||||
/* Disable and acknowledge interrupts */
|
||||
igb_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