* [NET-NEXT PATCH] Minor bnx2 patches
@ 2008-09-17 23:02 Benjamin Li
2008-09-17 23:02 ` NET-NEXT PATCH] bnx2: In bnx2_set_mac_link() return void rather then int Benjamin Li
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Benjamin Li @ 2008-09-17 23:02 UTC (permalink / raw)
Cc: benli, netdev@vger.kernel.org
These patches are some minor code cleanups. Nothing
major.
Please feel free to comment. Thanks again.
-Ben
Benjamin Li (4):
bnx2: In bnx2_set_mac_link() return void rather then int
bnx2: Update MODULE_DESCRIPTION to include the 5716
bnx2: Remove name field from bnx2 structure
bnx2: Remove timer_interval field from the bnx2 structure
drivers/net/bnx2.c | 20 ++++++++------------
drivers/net/bnx2.h | 4 +---
2 files changed, 9 insertions(+), 15 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* NET-NEXT PATCH] bnx2: In bnx2_set_mac_link() return void rather then int
2008-09-17 23:02 [NET-NEXT PATCH] Minor bnx2 patches Benjamin Li
@ 2008-09-17 23:02 ` Benjamin Li
2008-09-17 23:02 ` [NET-NEXT PATCH] bnx2: Update MODULE_DESCRIPTION to include the 5716 Benjamin Li
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Benjamin Li @ 2008-09-17 23:02 UTC (permalink / raw)
Cc: benli, netdev@vger.kernel.org
bnx2_set_mac_link() doesn't need to return any error codes. And
all the callers don't check the return code. It is safe to
change the return type to a void.
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/bnx2.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 2486a65..192a24e 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -1127,7 +1127,7 @@ bnx2_init_all_rx_contexts(struct bnx2 *bp)
}
}
-static int
+static void
bnx2_set_mac_link(struct bnx2 *bp)
{
u32 val;
@@ -1193,8 +1193,6 @@ bnx2_set_mac_link(struct bnx2 *bp)
if (CHIP_NUM(bp) == CHIP_NUM_5709)
bnx2_init_all_rx_contexts(bp);
-
- return 0;
}
static void
--
1.5.6.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [NET-NEXT PATCH] bnx2: Update MODULE_DESCRIPTION to include the 5716
2008-09-17 23:02 [NET-NEXT PATCH] Minor bnx2 patches Benjamin Li
2008-09-17 23:02 ` NET-NEXT PATCH] bnx2: In bnx2_set_mac_link() return void rather then int Benjamin Li
@ 2008-09-17 23:02 ` Benjamin Li
2008-09-17 23:02 ` [NET-NEXT PATCH] bnx2: Remove name field from bnx2 structure Benjamin Li
2008-09-17 23:02 ` [NET-NEXT PATCH] bnx2: Remove timer_interval field from the " Benjamin Li
3 siblings, 0 replies; 5+ messages in thread
From: Benjamin Li @ 2008-09-17 23:02 UTC (permalink / raw)
Cc: benli, netdev@vger.kernel.org
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/bnx2.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 192a24e..a78b664 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -69,7 +69,7 @@ static char version[] __devinitdata =
"Broadcom NetXtreme II Gigabit Ethernet Driver " DRV_MODULE_NAME " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
MODULE_AUTHOR("Michael Chan <mchan@broadcom.com>");
-MODULE_DESCRIPTION("Broadcom NetXtreme II BCM5706/5708/5709 Driver");
+MODULE_DESCRIPTION("Broadcom NetXtreme II BCM5706/5708/5709/5716 Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_MODULE_VERSION);
--
1.5.6.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [NET-NEXT PATCH] bnx2: Remove name field from bnx2 structure
2008-09-17 23:02 [NET-NEXT PATCH] Minor bnx2 patches Benjamin Li
2008-09-17 23:02 ` NET-NEXT PATCH] bnx2: In bnx2_set_mac_link() return void rather then int Benjamin Li
2008-09-17 23:02 ` [NET-NEXT PATCH] bnx2: Update MODULE_DESCRIPTION to include the 5716 Benjamin Li
@ 2008-09-17 23:02 ` Benjamin Li
2008-09-17 23:02 ` [NET-NEXT PATCH] bnx2: Remove timer_interval field from the " Benjamin Li
3 siblings, 0 replies; 5+ messages in thread
From: Benjamin Li @ 2008-09-17 23:02 UTC (permalink / raw)
Cc: benli, netdev@vger.kernel.org
The name of the board is only used during the initialization of
the adapter. We can save the space of a pointer by not storing
this information.
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/bnx2.c | 3 +--
drivers/net/bnx2.h | 2 --
2 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index a78b664..8417766 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -7718,7 +7718,6 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
memcpy(dev->dev_addr, bp->mac_addr, 6);
memcpy(dev->perm_addr, bp->mac_addr, 6);
- bp->name = board_info[ent->driver_data].name;
dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
if (CHIP_NUM(bp) == CHIP_NUM_5709)
@@ -7745,7 +7744,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
printk(KERN_INFO "%s: %s (%c%d) %s found at mem %lx, "
"IRQ %d, node addr %s\n",
dev->name,
- bp->name,
+ board_info[ent->driver_data].name,
((CHIP_ID(bp) & 0xf000) >> 12) + 'A',
((CHIP_ID(bp) & 0x0ff0) >> 4),
bnx2_bus_string(bp, str),
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index c3c579f..cb47c98 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -6701,8 +6701,6 @@ struct bnx2 {
/* End of fields used in the performance code paths. */
- char *name;
-
int timer_interval;
int current_interval;
struct timer_list timer;
--
1.5.6.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [NET-NEXT PATCH] bnx2: Remove timer_interval field from the bnx2 structure
2008-09-17 23:02 [NET-NEXT PATCH] Minor bnx2 patches Benjamin Li
` (2 preceding siblings ...)
2008-09-17 23:02 ` [NET-NEXT PATCH] bnx2: Remove name field from bnx2 structure Benjamin Li
@ 2008-09-17 23:02 ` Benjamin Li
3 siblings, 0 replies; 5+ messages in thread
From: Benjamin Li @ 2008-09-17 23:02 UTC (permalink / raw)
Cc: benli, netdev@vger.kernel.org
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 | 11 +++++------
drivers/net/bnx2.h | 2 +-
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 8417766..1b5b152 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,7 +7514,6 @@ 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->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..e534c1d 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -6701,7 +6701,7 @@ struct bnx2 {
/* End of fields used in the performance code paths. */
- int timer_interval;
+#define BNX2_TIMER_INTERVAL HZ
int current_interval;
struct timer_list timer;
struct work_struct reset_task;
--
1.5.6.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-09-17 23:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-17 23:02 [NET-NEXT PATCH] Minor bnx2 patches Benjamin Li
2008-09-17 23:02 ` NET-NEXT PATCH] bnx2: In bnx2_set_mac_link() return void rather then int Benjamin Li
2008-09-17 23:02 ` [NET-NEXT PATCH] bnx2: Update MODULE_DESCRIPTION to include the 5716 Benjamin Li
2008-09-17 23:02 ` [NET-NEXT PATCH] bnx2: Remove name field from bnx2 structure Benjamin Li
2008-09-17 23:02 ` [NET-NEXT PATCH] bnx2: Remove timer_interval field from the " Benjamin Li
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).