diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2010-09-10 21:08:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-13 23:02:51 -0400 |
commit | 1570475a477b46cb16b2a0dd73c06974c8d2b550 (patch) | |
tree | 8d13fce770e4210446834277cd78c588686f5acc /drivers/net/tulip | |
parent | 61a21455ee27dccdd286f61aea611da5e70b47bf (diff) |
net/de4x5: remove undefined operations
Modifying an object twice without an intervening sequence point is
undefined.
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r-- | drivers/net/tulip/de4x5.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index 75a64c88cf7a..4f7503063446 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c | |||
@@ -1448,7 +1448,7 @@ de4x5_sw_reset(struct net_device *dev) | |||
1448 | status = -EIO; | 1448 | status = -EIO; |
1449 | } | 1449 | } |
1450 | 1450 | ||
1451 | lp->tx_new = (++lp->tx_new) % lp->txRingSize; | 1451 | lp->tx_new = (lp->tx_new + 1) % lp->txRingSize; |
1452 | lp->tx_old = lp->tx_new; | 1452 | lp->tx_old = lp->tx_new; |
1453 | 1453 | ||
1454 | return status; | 1454 | return status; |
@@ -1506,7 +1506,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) | |||
1506 | lp->stats.tx_bytes += skb->len; | 1506 | lp->stats.tx_bytes += skb->len; |
1507 | outl(POLL_DEMAND, DE4X5_TPD);/* Start the TX */ | 1507 | outl(POLL_DEMAND, DE4X5_TPD);/* Start the TX */ |
1508 | 1508 | ||
1509 | lp->tx_new = (++lp->tx_new) % lp->txRingSize; | 1509 | lp->tx_new = (lp->tx_new + 1) % lp->txRingSize; |
1510 | 1510 | ||
1511 | if (TX_BUFFS_AVAIL) { | 1511 | if (TX_BUFFS_AVAIL) { |
1512 | netif_start_queue(dev); /* Another pkt may be queued */ | 1512 | netif_start_queue(dev); /* Another pkt may be queued */ |
@@ -1657,7 +1657,7 @@ de4x5_rx(struct net_device *dev) | |||
1657 | } | 1657 | } |
1658 | 1658 | ||
1659 | /* Change buffer ownership for this frame, back to the adapter */ | 1659 | /* Change buffer ownership for this frame, back to the adapter */ |
1660 | for (;lp->rx_old!=entry;lp->rx_old=(++lp->rx_old)%lp->rxRingSize) { | 1660 | for (;lp->rx_old!=entry;lp->rx_old=(lp->rx_old + 1)%lp->rxRingSize) { |
1661 | lp->rx_ring[lp->rx_old].status = cpu_to_le32(R_OWN); | 1661 | lp->rx_ring[lp->rx_old].status = cpu_to_le32(R_OWN); |
1662 | barrier(); | 1662 | barrier(); |
1663 | } | 1663 | } |
@@ -1668,7 +1668,7 @@ de4x5_rx(struct net_device *dev) | |||
1668 | /* | 1668 | /* |
1669 | ** Update entry information | 1669 | ** Update entry information |
1670 | */ | 1670 | */ |
1671 | lp->rx_new = (++lp->rx_new) % lp->rxRingSize; | 1671 | lp->rx_new = (lp->rx_new + 1) % lp->rxRingSize; |
1672 | } | 1672 | } |
1673 | 1673 | ||
1674 | return 0; | 1674 | return 0; |
@@ -1726,7 +1726,7 @@ de4x5_tx(struct net_device *dev) | |||
1726 | } | 1726 | } |
1727 | 1727 | ||
1728 | /* Update all the pointers */ | 1728 | /* Update all the pointers */ |
1729 | lp->tx_old = (++lp->tx_old) % lp->txRingSize; | 1729 | lp->tx_old = (lp->tx_old + 1) % lp->txRingSize; |
1730 | } | 1730 | } |
1731 | 1731 | ||
1732 | /* Any resources available? */ | 1732 | /* Any resources available? */ |
@@ -1801,7 +1801,7 @@ de4x5_rx_ovfc(struct net_device *dev) | |||
1801 | 1801 | ||
1802 | for (; (s32)le32_to_cpu(lp->rx_ring[lp->rx_new].status)>=0;) { | 1802 | for (; (s32)le32_to_cpu(lp->rx_ring[lp->rx_new].status)>=0;) { |
1803 | lp->rx_ring[lp->rx_new].status = cpu_to_le32(R_OWN); | 1803 | lp->rx_ring[lp->rx_new].status = cpu_to_le32(R_OWN); |
1804 | lp->rx_new = (++lp->rx_new % lp->rxRingSize); | 1804 | lp->rx_new = (lp->rx_new + 1) % lp->rxRingSize; |
1805 | } | 1805 | } |
1806 | 1806 | ||
1807 | outl(omr, DE4X5_OMR); | 1807 | outl(omr, DE4X5_OMR); |
@@ -1932,7 +1932,7 @@ set_multicast_list(struct net_device *dev) | |||
1932 | load_packet(dev, lp->setup_frame, TD_IC | PERFECT_F | TD_SET | | 1932 | load_packet(dev, lp->setup_frame, TD_IC | PERFECT_F | TD_SET | |
1933 | SETUP_FRAME_LEN, (struct sk_buff *)1); | 1933 | SETUP_FRAME_LEN, (struct sk_buff *)1); |
1934 | 1934 | ||
1935 | lp->tx_new = (++lp->tx_new) % lp->txRingSize; | 1935 | lp->tx_new = (lp->tx_new + 1) % lp->txRingSize; |
1936 | outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */ | 1936 | outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */ |
1937 | dev->trans_start = jiffies; /* prevent tx timeout */ | 1937 | dev->trans_start = jiffies; /* prevent tx timeout */ |
1938 | } | 1938 | } |
@@ -3568,7 +3568,7 @@ ping_media(struct net_device *dev, int msec) | |||
3568 | 3568 | ||
3569 | lp->tmp = lp->tx_new; /* Remember the ring position */ | 3569 | lp->tmp = lp->tx_new; /* Remember the ring position */ |
3570 | load_packet(dev, lp->frame, TD_LS | TD_FS | sizeof(lp->frame), (struct sk_buff *)1); | 3570 | load_packet(dev, lp->frame, TD_LS | TD_FS | sizeof(lp->frame), (struct sk_buff *)1); |
3571 | lp->tx_new = (++lp->tx_new) % lp->txRingSize; | 3571 | lp->tx_new = (lp->tx_new + 1) % lp->txRingSize; |
3572 | outl(POLL_DEMAND, DE4X5_TPD); | 3572 | outl(POLL_DEMAND, DE4X5_TPD); |
3573 | } | 3573 | } |
3574 | 3574 | ||
@@ -5417,7 +5417,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
5417 | /* Set up the descriptor and give ownership to the card */ | 5417 | /* Set up the descriptor and give ownership to the card */ |
5418 | load_packet(dev, lp->setup_frame, TD_IC | PERFECT_F | TD_SET | | 5418 | load_packet(dev, lp->setup_frame, TD_IC | PERFECT_F | TD_SET | |
5419 | SETUP_FRAME_LEN, (struct sk_buff *)1); | 5419 | SETUP_FRAME_LEN, (struct sk_buff *)1); |
5420 | lp->tx_new = (++lp->tx_new) % lp->txRingSize; | 5420 | lp->tx_new = (lp->tx_new + 1) % lp->txRingSize; |
5421 | outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */ | 5421 | outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */ |
5422 | netif_wake_queue(dev); /* Unlock the TX ring */ | 5422 | netif_wake_queue(dev); /* Unlock the TX ring */ |
5423 | break; | 5423 | break; |