Skip to content

Commit

Permalink
NET: sungem, use spin_trylock_irqsave
Browse files Browse the repository at this point in the history
Use spin_trylock_irqsave instead of open-coded
local_irq_save+spin_trylock.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Slaby authored and David S. Miller committed Nov 4, 2009
1 parent c6d14c8 commit b8883a6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/sungem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,10 +1033,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() */
Expand Down

0 comments on commit b8883a6

Please sign in to comment.