Ignore:
Timestamp:
2010-01-31T13:48:48+01:00 (7 years ago)
Author:
juhosg
Message:

ramips_eth: simplify tx_next computation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ramips/files/drivers/net/ramips.c

    r19443 r19444  
    164164        spin_lock_irqsave(&priv->page_lock, flags); 
    165165        tx = ramips_fe_rr(RAMIPS_TX_CTX_IDX0); 
    166         if (tx == NUM_TX_DESC - 1) 
    167                 tx_next = 0; 
    168         else 
    169                 tx_next = tx + 1; 
     166        tx_next = (tx + 1) % NUM_TX_DESC; 
    170167 
    171168        if ((priv->tx_skb[tx]) || (priv->tx_skb[tx_next]) || 
     
    181178        priv->tx_skb[tx] = skb; 
    182179        wmb(); 
    183         ramips_fe_wr((tx + 1) % NUM_TX_DESC, RAMIPS_TX_CTX_IDX0); 
     180        ramips_fe_wr(tx_next, RAMIPS_TX_CTX_IDX0); 
    184181        spin_unlock_irqrestore(&priv->page_lock, flags); 
    185182        return NETDEV_TX_OK; 
Note: See TracChangeset for help on using the changeset viewer.