netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Don Fry <brazilnut@us.ibm.com>
To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@vger.kernel.org
Subject: [PATCH 1/5] pcnet32:  remove unnecessary save/restore register accesses.
Date: Wed, 13 Sep 2006 10:15:43 -0700	[thread overview]
Message-ID: <20060913171543.GA12746@us.ibm.com> (raw)

Delete unnecessary save/restore of rap in interrupt handler and statistics.

tested ia32 and ppc64.

Signed-off-by:  Don Fry <brazilnut@us.ibm.com>

--- linux-2.6.18-rc6/drivers/net/pcnet32.c.orig	Fri Sep  8 14:02:12 2006
+++ linux-2.6.18-rc6/drivers/net/pcnet32.c	Tue Sep 12 10:09:12 2006
@@ -2262,7 +2262,7 @@ pcnet32_interrupt(int irq, void *dev_id,
 	struct net_device *dev = dev_id;
 	struct pcnet32_private *lp;
 	unsigned long ioaddr;
-	u16 csr0, rap;
+	u16 csr0;
 	int boguscnt = max_interrupt_work;
 	int must_restart;
 
@@ -2278,7 +2278,6 @@ pcnet32_interrupt(int irq, void *dev_id,
 
 	spin_lock(&lp->lock);
 
-	rap = lp->a.read_rap(ioaddr);
 	while ((csr0 = lp->a.read_csr(ioaddr, 0)) & 0x8f00 && --boguscnt >= 0) {
 		if (csr0 == 0xffff) {
 			break;	/* PCMCIA remove happened */
@@ -2434,7 +2433,6 @@ pcnet32_interrupt(int irq, void *dev_id,
 
 	/* Set interrupt enable. */
 	lp->a.write_csr(ioaddr, 0, 0x0040);
-	lp->a.write_rap(ioaddr, rap);
 
 	if (netif_msg_intr(lp))
 		printk(KERN_DEBUG "%s: exiting interrupt, csr0=%#4.4x.\n",
@@ -2647,13 +2645,10 @@ static struct net_device_stats *pcnet32_
 {
 	struct pcnet32_private *lp = dev->priv;
 	unsigned long ioaddr = dev->base_addr;
-	u16 saved_addr;
 	unsigned long flags;
 
 	spin_lock_irqsave(&lp->lock, flags);
-	saved_addr = lp->a.read_rap(ioaddr);
 	lp->stats.rx_missed_errors = lp->a.read_csr(ioaddr, 112);
-	lp->a.write_rap(ioaddr, saved_addr);
 	spin_unlock_irqrestore(&lp->lock, flags);
 
 	return &lp->stats;
-- 
Don Fry
brazilnut@us.ibm.com

             reply	other threads:[~2006-09-13 17:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-13 17:15 Don Fry [this message]
2006-09-13 17:25 ` [PATCH 1/5] pcnet32: remove unnecessary save/restore register accesses Jeff Garzik

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=20060913171543.GA12746@us.ibm.com \
    --to=brazilnut@us.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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).