netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] NET: sungem, use spin_trylock_irqsave
@ 2009-11-04 16:06 Jiri Slaby
  2009-11-04 16:37 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2009-11-04 16:06 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, Jiri Slaby

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 7019a0d..51bde03 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -1034,10 +1034,8 @@ static netdev_tx_t gem_start_xmit(struct sk_buff *skb,
 			(csum_stuff_off << 21));
 	}
 
-	local_irq_save(flags);
-	if (!spin_trylock(&gp->tx_lock)) {
+	if (!spin_trylock_irqsave(&gp->tx_lock, flags)) {
 		/* Tell upper layer to requeue */
-		local_irq_restore(flags);
 		return NETDEV_TX_LOCKED;
 	}
 	/* We raced with gem_do_stop() */
-- 
1.6.4.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] NET: sungem, use spin_trylock_irqsave
  2009-11-04 16:06 [PATCH 1/1] NET: sungem, use spin_trylock_irqsave Jiri Slaby
@ 2009-11-04 16:37 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-11-04 16:37 UTC (permalink / raw)
  To: jirislaby; +Cc: netdev, linux-kernel

From: Jiri Slaby <jirislaby@gmail.com>
Date: Wed,  4 Nov 2009 17:06:58 +0100

> Use spin_trylock_irqsave instead of open-coded
> local_irq_save+spin_trylock.
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-04 16:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-04 16:06 [PATCH 1/1] NET: sungem, use spin_trylock_irqsave Jiri Slaby
2009-11-04 16:37 ` David Miller

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).