netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Benjamin Li" <benli@broadcom.com>
To: "Jeff Garzik" <jeff@garzik.org>
Cc: benli@broadcom.com, "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: [UPDATED][NET-NEXT PATCH 4/4] bnx2: Remove timer_interval field from the bnx2 structure
Date: Thu, 18 Sep 2008 09:57:13 -0700	[thread overview]
Message-ID: <1221757033-4874-5-git-send-email-benli@broadcom.com> (raw)
In-Reply-To: <1221757033-4874-4-git-send-email-benli@broadcom.com>

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: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/bnx2.c |   13 ++++++-------
 drivers/net/bnx2.h |    3 ++-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 8417766..883e0a7 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -5598,7 +5598,7 @@ bnx2_5706_serdes_timer(struct bnx2 *bp)
 	} else if ((bp->link_up == 0) && (bp->autoneg & AUTONEG_SPEED)) {
 		u32 bmcr;
 
-		bp->current_interval = bp->timer_interval;
+		bp->current_interval = BNX2_TIMER_INTERVAL;
 
 		bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
 
@@ -5627,7 +5627,7 @@ bnx2_5706_serdes_timer(struct bnx2 *bp)
 			bp->phy_flags &= ~BNX2_PHY_FLAG_PARALLEL_DETECT;
 		}
 	} else
-		bp->current_interval = bp->timer_interval;
+		bp->current_interval = BNX2_TIMER_INTERVAL;
 
 	if (check_link) {
 		u32 val;
@@ -5672,11 +5672,11 @@ bnx2_5708_serdes_timer(struct bnx2 *bp)
 		} else {
 			bnx2_disable_forced_2g5(bp);
 			bp->serdes_an_pending = 2;
-			bp->current_interval = bp->timer_interval;
+			bp->current_interval = BNX2_TIMER_INTERVAL;
 		}
 
 	} else
-		bp->current_interval = bp->timer_interval;
+		bp->current_interval = BNX2_TIMER_INTERVAL;
 
 	spin_unlock(&bp->phy_lock);
 }
@@ -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->timer_interval =  HZ;
-	bp->current_interval =  HZ;
+	bp->current_interval = BNX2_TIMER_INTERVAL;
 
 	bp->phy_addr = 1;
 
@@ -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;
 
 	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.function = bnx2_timer;
 
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index cb47c98..682b8f0 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -6654,6 +6654,8 @@ struct bnx2_napi {
 	struct bnx2_tx_ring_info	tx_ring;
 };
 
+#define BNX2_TIMER_INTERVAL			HZ
+
 struct bnx2 {
 	/* Fields used in the tx and intr/napi performance paths are grouped */
 	/* together in the beginning of the structure. */
@@ -6701,7 +6703,6 @@ struct bnx2 {
 
 	/* End of fields used in the performance code paths. */
 
-	int			timer_interval;
 	int			current_interval;
 	struct			timer_list timer;
 	struct work_struct	reset_task;
-- 
1.6.0.1



  reply	other threads:[~2008-09-18 16:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080918063933.GA8027@verge.net.au>
2008-09-18 16:57 ` [UPDATED][NET-NEXT PATCH 0/4] Minor bnx2 patches Benjamin Li
2008-09-18 16:57   ` [UPDATED][NET-NEXT PATCH 1/4] bnx2: In bnx2_set_mac_link() return void rather then int Benjamin Li
2008-09-18 16:57     ` [UPDATED][NET-NEXT PATCH 2/4] bnx2: Update MODULE_DESCRIPTION to include the 5716 Benjamin Li
2008-09-18 16:57       ` [UPDATED][NET-NEXT PATCH 3/4] bnx2: Remove name field from bnx2 structure Benjamin Li
2008-09-18 16:57         ` Benjamin Li [this message]
2008-09-18 23:40           ` [UPDATED][NET-NEXT PATCH 4/4] bnx2: Remove timer_interval field from the " David Miller
2008-09-18 23:40         ` [UPDATED][NET-NEXT PATCH 3/4] bnx2: Remove name field from " David Miller
2008-09-18 22:29       ` [UPDATED][NET-NEXT PATCH 2/4] bnx2: Update MODULE_DESCRIPTION to include the 5716 David Miller
2008-09-18 23:39       ` David Miller
2008-09-18 23:38     ` [UPDATED][NET-NEXT PATCH 1/4] bnx2: In bnx2_set_mac_link() return void rather then int David Miller
2008-09-18 17:04   ` [UPDATED][NET-NEXT PATCH 0/4] Minor bnx2 patches Jeff Garzik
2008-09-18 22:30     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1221757033-4874-5-git-send-email-benli@broadcom.com \
    --to=benli@broadcom.com \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).