net: use symbolic values for ndo_start_xmit() return codes
Convert magic values 1 and -1 to NETDEV_TX_BUSY and NETDEV_TX_LOCKED respectively. 0 (NETDEV_TX_OK) is not changed to keep the noise down, except in very few cases where its in direct proximity to one of the other values. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
5b2c4b972c
commit
5b54814022
@@ -612,7 +612,7 @@ static int de_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
||||
if (tx_free == 0) {
|
||||
netif_stop_queue(dev);
|
||||
spin_unlock_irq(&de->lock);
|
||||
return 1;
|
||||
return NETDEV_TX_BUSY;
|
||||
}
|
||||
tx_free--;
|
||||
|
||||
|
||||
@@ -1461,12 +1461,12 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
struct de4x5_private *lp = netdev_priv(dev);
|
||||
u_long iobase = dev->base_addr;
|
||||
int status = 0;
|
||||
int status = NETDEV_TX_OK;
|
||||
u_long flags = 0;
|
||||
|
||||
netif_stop_queue(dev);
|
||||
if (!lp->tx_enable) { /* Cannot send for now */
|
||||
return -1;
|
||||
return NETDEV_TX_LOCKED;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1480,7 +1480,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
|
||||
|
||||
/* Test if cache is already locked - requeue skb if so */
|
||||
if (test_and_set_bit(0, (void *)&lp->cache.lock) && !lp->interrupt)
|
||||
return -1;
|
||||
return NETDEV_TX_LOCKED;
|
||||
|
||||
/* Transmit descriptor ring full or stale skb */
|
||||
if (netif_queue_stopped(dev) || (u_long) lp->tx_skb[lp->tx_new] > 1) {
|
||||
|
||||
@@ -686,7 +686,7 @@ static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev)
|
||||
spin_unlock_irqrestore(&db->lock, flags);
|
||||
printk(KERN_ERR DRV_NAME ": No Tx resource %ld\n",
|
||||
db->tx_queue_cnt);
|
||||
return 1;
|
||||
return NETDEV_TX_BUSY;
|
||||
}
|
||||
|
||||
/* Disable NIC interrupt */
|
||||
|
||||
@@ -591,7 +591,7 @@ static int uli526x_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
if (db->tx_packet_cnt >= TX_FREE_DESC_CNT) {
|
||||
spin_unlock_irqrestore(&db->lock, flags);
|
||||
printk(KERN_ERR DRV_NAME ": No Tx resource %ld\n", db->tx_packet_cnt);
|
||||
return 1;
|
||||
return NETDEV_TX_BUSY;
|
||||
}
|
||||
|
||||
/* Disable NIC interrupt */
|
||||
|
||||
Reference in New Issue
Block a user