From: Jiri Slaby <jirislaby@gmail.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiri Slaby <jirislaby@gmail.com>
Subject: [PATCH 2/2] NET: sungem, use spin_trylock_irqsave
Date: Mon, 13 Jul 2009 23:23:40 +0200 [thread overview]
Message-ID: <1247520220-31960-2-git-send-email-jirislaby@gmail.com> (raw)
In-Reply-To: <1247520220-31960-1-git-send-email-jirislaby@gmail.com>
Use spin_trylock_irqsave instead of open-coded
local_irq_save+spin_trylock.
Impact: cleanup
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
drivers/net/sungem.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index d2dfe0a..22474a8 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -1032,10 +1032,8 @@ static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
(csum_stuff_off << 21));
}
- local_irq_save(flags);
- if (!spin_trylock(&gp->tx_lock)) {
+ if (!spin_trylock_irqsave(&gp->tx_lock)) {
/* Tell upper layer to requeue */
- local_irq_restore(flags);
return NETDEV_TX_LOCKED;
}
/* We raced with gem_do_stop() */
--
1.6.3.2
next prev parent reply other threads:[~2009-07-13 21:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-13 21:23 [PATCH 1/2] NET: phy_device, fix lock imbalance Jiri Slaby
2009-07-13 21:23 ` Jiri Slaby [this message]
2009-07-14 2:12 ` [PATCH 2/2] NET: sungem, use spin_trylock_irqsave David Miller
2009-07-14 21:10 ` David Miller
2009-07-14 21:18 ` Jiri Slaby
2009-07-14 19:27 ` [PATCH 1/2] NET: phy_device, fix lock imbalance 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=1247520220-31960-2-git-send-email-jirislaby@gmail.com \
--to=jirislaby@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.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).