From: Brandon Niemczyk <brandon@snprogramming.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] cli() cleanup in xircom_tulip_cp.c and fec.c
Date: Tue, 12 Jul 2005 01:37:17 +0000 [thread overview]
Message-ID: <1121132237.3554.56.camel@localhost> (raw)
In-Reply-To: <1121121132.3554.50.camel@localhost>
[-- Attachment #1: Type: text/plain, Size: 1866 bytes --]
Please discard the previous patch. I'm going to take these one at a
time. Here's a patch for the fec code, it also makes some global
variables that aren't used anywhere or declared in a header static.
Signed-off-by: Brandon Niemczyk <brandon@snprogramming.com>
diff -pruNX anti-cli/Documentation/dontdiff linux-pristine/drivers/net/fec.c anti-cli/drivers/net/fec.c
--- linux-pristine/drivers/net/fec.c 2005-06-17 15:48:29.000000000 -0400
+++ anti-cli/drivers/net/fec.c 2005-07-11 21:29:38.000000000 -0400
@@ -237,10 +237,11 @@ typedef struct mii_list {
} mii_list_t;
#define NMII 20
-mii_list_t mii_cmds[NMII];
-mii_list_t *mii_free;
-mii_list_t *mii_head;
-mii_list_t *mii_tail;
+static mii_list_t mii_cmds[NMII];
+static mii_list_t *mii_free;
+static mii_list_t *mii_head;
+static mii_list_t *mii_tail;
+static DECLARE_SPINLOCK(mii_lock);
static int mii_queue(struct net_device *dev, int request,
void (*func)(uint, struct net_device *));
@@ -679,10 +680,13 @@ fec_enet_mii(struct net_device *dev)
volatile fec_t *ep;
mii_list_t *mip;
uint mii_reg;
+ unsigned long flags;
fep = netdev_priv(dev);
ep = fep->hwp;
mii_reg = ep->fec_mii_data;
+
+ spin_lock_irqsave(&mii_lock, flags);
if ((mip = mii_head) == NULL) {
printk("MII and no head!\n");
@@ -698,6 +702,8 @@ fec_enet_mii(struct net_device *dev)
if ((mip = mii_head) != NULL)
ep->fec_mii_data = mip->mii_regval;
+
+ spin_unlock_irqrestore(&mii_lock, flags);
}
static int
@@ -715,8 +721,7 @@ mii_queue(struct net_device *dev, int re
retval = 0;
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&mii_lock, flags);
if ((mip = mii_free) != NULL) {
mii_free = mip->mii_next;
@@ -736,7 +741,7 @@ mii_queue(struct net_device *dev, int re
retval = 1;
}
- restore_flags(flags);
+ spin_unlock_irqrestore(&mii_lock, flags);
return(retval);
}
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
prev parent reply other threads:[~2005-07-12 1:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-11 22:32 [KJ] [PATCH] cli() cleanup in xircom_tulip_cp.c and fec.c Brandon Niemczyk
2005-07-12 1:37 ` Brandon Niemczyk [this message]
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=1121132237.3554.56.camel@localhost \
--to=brandon@snprogramming.com \
--cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.