diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-07-21 14:55:38 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-21 14:55:38 -0700 |
commit | 53c4b2cc7a05c034fd21d104d2ab43ea8cc0e075 (patch) | |
tree | ede0678aaf5f3262773f10f64a221bef671cda55 /include/linux/netdevice.h | |
parent | bf9915cc55cb8d18d4e3a8de3d1578a9af4a2e8b (diff) | |
download | kernel-crypto-53c4b2cc7a05c034fd21d104d2ab43ea8cc0e075.tar.gz kernel-crypto-53c4b2cc7a05c034fd21d104d2ab43ea8cc0e075.tar.xz kernel-crypto-53c4b2cc7a05c034fd21d104d2ab43ea8cc0e075.zip |
[NET]: Fix reversed error test in netif_tx_trylock
A non-zero return value indicates success from spin_trylock,
not error.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 76cc099c858..75f02d8c6ed 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -924,10 +924,10 @@ static inline void netif_tx_lock_bh(struct net_device *dev) static inline int netif_tx_trylock(struct net_device *dev) { - int err = spin_trylock(&dev->_xmit_lock); - if (!err) + int ok = spin_trylock(&dev->_xmit_lock); + if (likely(ok)) dev->xmit_lock_owner = smp_processor_id(); - return err; + return ok; } static inline void netif_tx_unlock(struct net_device *dev) |