提交 b8883a65 编写于 作者: J Jiri Slaby 提交者: David S. Miller

NET: sungem, use spin_trylock_irqsave

Use spin_trylock_irqsave instead of open-coded
local_irq_save+spin_trylock.
Signed-off-by: NJiri Slaby <jirislaby@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c6d14c84
...@@ -1033,10 +1033,8 @@ static netdev_tx_t gem_start_xmit(struct sk_buff *skb, ...@@ -1033,10 +1033,8 @@ static netdev_tx_t gem_start_xmit(struct sk_buff *skb,
(csum_stuff_off << 21)); (csum_stuff_off << 21));
} }
local_irq_save(flags); if (!spin_trylock_irqsave(&gp->tx_lock, flags)) {
if (!spin_trylock(&gp->tx_lock)) {
/* Tell upper layer to requeue */ /* Tell upper layer to requeue */
local_irq_restore(flags);
return NETDEV_TX_LOCKED; return NETDEV_TX_LOCKED;
} }
/* We raced with gem_do_stop() */ /* We raced with gem_do_stop() */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册