Commit ac392abc authored by Benjamin Li's avatar Benjamin Li Committed by David S. Miller

bnx2: Remove timer_interval field from the bnx2 structure

The timer_interval field is only assigned once, and never reassigned.
We can safely replace all instances of the timer_interval with a
constant value.
Signed-off-by: default avatarBenjamin Li <benli@broadcom.com>
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Acked-by: default avatarJeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fbbf68b7
...@@ -5598,7 +5598,7 @@ bnx2_5706_serdes_timer(struct bnx2 *bp) ...@@ -5598,7 +5598,7 @@ bnx2_5706_serdes_timer(struct bnx2 *bp)
} else if ((bp->link_up == 0) && (bp->autoneg & AUTONEG_SPEED)) { } else if ((bp->link_up == 0) && (bp->autoneg & AUTONEG_SPEED)) {
u32 bmcr; u32 bmcr;
bp->current_interval = bp->timer_interval; bp->current_interval = BNX2_TIMER_INTERVAL;
bnx2_read_phy(bp, bp->mii_bmcr, &bmcr); bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
...@@ -5627,7 +5627,7 @@ bnx2_5706_serdes_timer(struct bnx2 *bp) ...@@ -5627,7 +5627,7 @@ bnx2_5706_serdes_timer(struct bnx2 *bp)
bp->phy_flags &= ~BNX2_PHY_FLAG_PARALLEL_DETECT; bp->phy_flags &= ~BNX2_PHY_FLAG_PARALLEL_DETECT;
} }
} else } else
bp->current_interval = bp->timer_interval; bp->current_interval = BNX2_TIMER_INTERVAL;
if (check_link) { if (check_link) {
u32 val; u32 val;
...@@ -5672,11 +5672,11 @@ bnx2_5708_serdes_timer(struct bnx2 *bp) ...@@ -5672,11 +5672,11 @@ bnx2_5708_serdes_timer(struct bnx2 *bp)
} else { } else {
bnx2_disable_forced_2g5(bp); bnx2_disable_forced_2g5(bp);
bp->serdes_an_pending = 2; bp->serdes_an_pending = 2;
bp->current_interval = bp->timer_interval; bp->current_interval = BNX2_TIMER_INTERVAL;
} }
} else } else
bp->current_interval = bp->timer_interval; bp->current_interval = BNX2_TIMER_INTERVAL;
spin_unlock(&bp->phy_lock); spin_unlock(&bp->phy_lock);
} }
...@@ -7514,8 +7514,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) ...@@ -7514,8 +7514,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
bp->stats_ticks = USEC_PER_SEC & BNX2_HC_STATS_TICKS_HC_STAT_TICKS; bp->stats_ticks = USEC_PER_SEC & BNX2_HC_STATS_TICKS_HC_STAT_TICKS;
bp->timer_interval = HZ; bp->current_interval = BNX2_TIMER_INTERVAL;
bp->current_interval = HZ;
bp->phy_addr = 1; bp->phy_addr = 1;
...@@ -7605,7 +7604,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) ...@@ -7605,7 +7604,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
bp->req_flow_ctrl = FLOW_CTRL_RX | FLOW_CTRL_TX; bp->req_flow_ctrl = FLOW_CTRL_RX | FLOW_CTRL_TX;
init_timer(&bp->timer); init_timer(&bp->timer);
bp->timer.expires = RUN_AT(bp->timer_interval); bp->timer.expires = RUN_AT(BNX2_TIMER_INTERVAL);
bp->timer.data = (unsigned long) bp; bp->timer.data = (unsigned long) bp;
bp->timer.function = bnx2_timer; bp->timer.function = bnx2_timer;
......
...@@ -6654,6 +6654,8 @@ struct bnx2_napi { ...@@ -6654,6 +6654,8 @@ struct bnx2_napi {
struct bnx2_tx_ring_info tx_ring; struct bnx2_tx_ring_info tx_ring;
}; };
#define BNX2_TIMER_INTERVAL HZ
struct bnx2 { struct bnx2 {
/* Fields used in the tx and intr/napi performance paths are grouped */ /* Fields used in the tx and intr/napi performance paths are grouped */
/* together in the beginning of the structure. */ /* together in the beginning of the structure. */
...@@ -6701,7 +6703,6 @@ struct bnx2 { ...@@ -6701,7 +6703,6 @@ struct bnx2 {
/* End of fields used in the performance code paths. */ /* End of fields used in the performance code paths. */
int timer_interval;
int current_interval; int current_interval;
struct timer_list timer; struct timer_list timer;
struct work_struct reset_task; struct work_struct reset_task;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment