aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcnet32.c
diff options
context:
space:
mode:
authorDon Fry <brazilnut@us.ibm.com>2006-09-13 13:15:43 -0400
committerJeff Garzik <jeff@garzik.org>2006-09-13 13:23:52 -0400
commit5c99346a3358a9c3c3fcf38669c05ac5f06832c9 (patch)
tree548f8ef561cf81069b41a709f6241704f63d3405 /drivers/net/pcnet32.c
parent38ed61d6c0b2c35fbaa1ccdb497543a18509d401 (diff)
[PATCH] pcnet32: remove unnecessary save/restore register accesses.
Delete unnecessary save/restore of rap in interrupt handler and statistics. tested ia32 and ppc64. Signed-off-by: Don Fry <brazilnut@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/pcnet32.c')
-rw-r--r--drivers/net/pcnet32.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 5e26fe806e21..98b7ab281622 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -2262,7 +2262,7 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2262 struct net_device *dev = dev_id; 2262 struct net_device *dev = dev_id;
2263 struct pcnet32_private *lp; 2263 struct pcnet32_private *lp;
2264 unsigned long ioaddr; 2264 unsigned long ioaddr;
2265 u16 csr0, rap; 2265 u16 csr0;
2266 int boguscnt = max_interrupt_work; 2266 int boguscnt = max_interrupt_work;
2267 int must_restart; 2267 int must_restart;
2268 2268
@@ -2278,7 +2278,6 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2278 2278
2279 spin_lock(&lp->lock); 2279 spin_lock(&lp->lock);
2280 2280
2281 rap = lp->a.read_rap(ioaddr);
2282 while ((csr0 = lp->a.read_csr(ioaddr, 0)) & 0x8f00 && --boguscnt >= 0) { 2281 while ((csr0 = lp->a.read_csr(ioaddr, 0)) & 0x8f00 && --boguscnt >= 0) {
2283 if (csr0 == 0xffff) { 2282 if (csr0 == 0xffff) {
2284 break; /* PCMCIA remove happened */ 2283 break; /* PCMCIA remove happened */
@@ -2434,7 +2433,6 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2434 2433
2435 /* Set interrupt enable. */ 2434 /* Set interrupt enable. */
2436 lp->a.write_csr(ioaddr, 0, 0x0040); 2435 lp->a.write_csr(ioaddr, 0, 0x0040);
2437 lp->a.write_rap(ioaddr, rap);
2438 2436
2439 if (netif_msg_intr(lp)) 2437 if (netif_msg_intr(lp))
2440 printk(KERN_DEBUG "%s: exiting interrupt, csr0=%#4.4x.\n", 2438 printk(KERN_DEBUG "%s: exiting interrupt, csr0=%#4.4x.\n",
@@ -2647,13 +2645,10 @@ static struct net_device_stats *pcnet32_get_stats(struct net_device *dev)
2647{ 2645{
2648 struct pcnet32_private *lp = dev->priv; 2646 struct pcnet32_private *lp = dev->priv;
2649 unsigned long ioaddr = dev->base_addr; 2647 unsigned long ioaddr = dev->base_addr;
2650 u16 saved_addr;
2651 unsigned long flags; 2648 unsigned long flags;
2652 2649
2653 spin_lock_irqsave(&lp->lock, flags); 2650 spin_lock_irqsave(&lp->lock, flags);
2654 saved_addr = lp->a.read_rap(ioaddr);
2655 lp->stats.rx_missed_errors = lp->a.read_csr(ioaddr, 112); 2651 lp->stats.rx_missed_errors = lp->a.read_csr(ioaddr, 112);
2656 lp->a.write_rap(ioaddr, saved_addr);
2657 spin_unlock_irqrestore(&lp->lock, flags); 2652 spin_unlock_irqrestore(&lp->lock, flags);
2658 2653
2659 return &lp->stats; 2654 return &lp->stats;