summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2011-08-30 03:09:42 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-08-31 00:48:48 +0200
commitb0b830433d9afbd8c5a7562ac5cebd6db2eacaa6 (patch)
tree0a987ecd81239ae97d1a73dbcd6adeb307ced546
parentb580f5b65267608c9e634f1216b66de2a21549dc (diff)
Fix undefined operation on assigning self pre-incremented variable
* linux/src/drivers/scsi/wd7000.c (mail_out): Add `1' instead of pre-incrementing self assigned variable. * linux/src/drivers/net/de4x5.c (de4x5_sw_reset, de4x5_queue_pkt, de4x5_rx) (de4x5_tx, de4x5_rx_ovfc, set_multicast_list, ping_media, mii_get_phy) (de4x5_ioctl): Likewise. * linux/src/drivers/net/depca.c (depca_rx, depca_tx, load_packet): Likewise.
-rw-r--r--linux/src/drivers/net/de4x5.c20
-rw-r--r--linux/src/drivers/net/depca.c8
-rw-r--r--linux/src/drivers/scsi/wd7000.c2
3 files changed, 15 insertions, 15 deletions
diff --git a/linux/src/drivers/net/de4x5.c b/linux/src/drivers/net/de4x5.c
index 114f6a7..a66f056 100644
--- a/linux/src/drivers/net/de4x5.c
+++ b/linux/src/drivers/net/de4x5.c
@@ -1493,7 +1493,7 @@ de4x5_sw_reset(struct device *dev)
status = -EIO;
}
- lp->tx_new = (++lp->tx_new) % lp->txRingSize;
+ lp->tx_new = (lp->tx_new + 1) % lp->txRingSize;
lp->tx_old = lp->tx_new;
return status;
@@ -1553,7 +1553,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct device *dev)
#endif
outl(POLL_DEMAND, DE4X5_TPD);/* Start the TX */
- lp->tx_new = (++lp->tx_new) % lp->txRingSize;
+ lp->tx_new = (lp->tx_new + 1) % lp->txRingSize;
dev->trans_start = jiffies;
if (TX_BUFFS_AVAIL) {
@@ -1708,7 +1708,7 @@ de4x5_rx(struct device *dev)
}
/* Change buffer ownership for this frame, back to the adapter */
- for (;lp->rx_old!=entry;lp->rx_old=(++lp->rx_old)%lp->rxRingSize) {
+ for (;lp->rx_old!=entry;lp->rx_old=(lp->rx_old+1)%lp->rxRingSize) {
lp->rx_ring[lp->rx_old].status = cpu_to_le32(R_OWN);
barrier();
}
@@ -1719,7 +1719,7 @@ de4x5_rx(struct device *dev)
/*
** Update entry information
*/
- lp->rx_new = (++lp->rx_new) % lp->rxRingSize;
+ lp->rx_new = (lp->rx_new + 1) % lp->rxRingSize;
}
return 0;
@@ -1768,7 +1768,7 @@ de4x5_tx(struct device *dev)
}
/* Update all the pointers */
- lp->tx_old = (++lp->tx_old) % lp->txRingSize;
+ lp->tx_old = (lp->tx_old + 1) % lp->txRingSize;
}
if (TX_BUFFS_AVAIL && dev->tbusy) { /* Any resources available? */
@@ -1838,7 +1838,7 @@ de4x5_rx_ovfc(struct device *dev)
for (; (s32)le32_to_cpu(lp->rx_ring[lp->rx_new].status)>=0;) {
lp->rx_ring[lp->rx_new].status = cpu_to_le32(R_OWN);
- lp->rx_new = (++lp->rx_new % lp->rxRingSize);
+ lp->rx_new = (lp->rx_new + 1) % lp->rxRingSize;
}
outl(omr, DE4X5_OMR);
@@ -1963,7 +1963,7 @@ set_multicast_list(struct device *dev)
load_packet(dev, lp->setup_frame, TD_IC | PERFECT_F | TD_SET |
SETUP_FRAME_LEN, NULL);
- lp->tx_new = (++lp->tx_new) % lp->txRingSize;
+ lp->tx_new = (lp->tx_new + 1) % lp->txRingSize;
outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */
dev->trans_start = jiffies;
}
@@ -3576,7 +3576,7 @@ ping_media(struct device *dev, int msec)
lp->tmp = lp->tx_new; /* Remember the ring position */
load_packet(dev, lp->frame, TD_LS | TD_FS | sizeof(lp->frame), NULL);
- lp->tx_new = (++lp->tx_new) % lp->txRingSize;
+ lp->tx_new = (lp->tx_new + 1) % lp->txRingSize;
outl(POLL_DEMAND, DE4X5_TPD);
}
@@ -5111,7 +5111,7 @@ mii_get_phy(struct device *dev)
lp->useMII = TRUE;
/* Search the MII address space for possible PHY devices */
- for (n=0, lp->mii_cnt=0, i=1; !((i==1) && (n==1)); i=(++i)%DE4X5_MAX_MII) {
+ for (n=0, lp->mii_cnt=0, i=1; !((i==1) && (n==1)); i=(i+1)%DE4X5_MAX_MII) {
lp->phy[lp->active].addr = i;
if (i==0) n++; /* Count cycles */
while (de4x5_reset_phy(dev)<0) udelay(100);/* Wait for reset */
@@ -5607,7 +5607,7 @@ de4x5_ioctl(struct device *dev, struct ifreq *rq, int cmd)
while (test_and_set_bit(0, (void *)&dev->tbusy) != 0);
load_packet(dev, lp->setup_frame, TD_IC | PERFECT_F | TD_SET |
SETUP_FRAME_LEN, NULL);
- lp->tx_new = (++lp->tx_new) % lp->txRingSize;
+ lp->tx_new = (lp->tx_new + 1) % lp->txRingSize;
outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */
dev->tbusy = 0; /* Unlock the TX ring */
diff --git a/linux/src/drivers/net/depca.c b/linux/src/drivers/net/depca.c
index 8cf6fc8..e1b0342 100644
--- a/linux/src/drivers/net/depca.c
+++ b/linux/src/drivers/net/depca.c
@@ -966,7 +966,7 @@ depca_rx(struct device *dev)
}
}
/* Change buffer ownership for this last frame, back to the adapter */
- for (; lp->rx_old!=entry; lp->rx_old=(++lp->rx_old)&lp->rxRingMask) {
+ for (; lp->rx_old!=entry; lp->rx_old=(lp->rx_old+1)&lp->rxRingMask) {
writel(readl(&lp->rx_ring[lp->rx_old].base) | R_OWN,
&lp->rx_ring[lp->rx_old].base);
}
@@ -976,7 +976,7 @@ depca_rx(struct device *dev)
/*
** Update entry information
*/
- lp->rx_new = (++lp->rx_new) & lp->rxRingMask;
+ lp->rx_new = (lp->rx_new + 1) & lp->rxRingMask;
}
return 0;
@@ -1017,7 +1017,7 @@ depca_tx(struct device *dev)
}
/* Update all the pointers */
- lp->tx_old = (++lp->tx_old) & lp->txRingMask;
+ lp->tx_old = (lp->tx_old + 1) & lp->txRingMask;
}
return 0;
@@ -1540,7 +1540,7 @@ static int load_packet(struct device *dev, struct sk_buff *skb)
/* set up the buffer descriptors */
len = (skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len;
- for (i = entry; i != end; i = (++i) & lp->txRingMask) {
+ for (i = entry; i != end; i = (i + 1) & lp->txRingMask) {
/* clean out flags */
writel(readl(&lp->tx_ring[i].base) & ~T_FLAGS, &lp->tx_ring[i].base);
writew(0x0000, &lp->tx_ring[i].misc); /* clears other error flags */
diff --git a/linux/src/drivers/scsi/wd7000.c b/linux/src/drivers/scsi/wd7000.c
index d910e27..08d3ac3 100644
--- a/linux/src/drivers/scsi/wd7000.c
+++ b/linux/src/drivers/scsi/wd7000.c
@@ -573,7 +573,7 @@ static int mail_out (Adapter *host, Scb *scbptr)
break;
}
else
- ogmb = (++ogmb) % OGMB_CNT;
+ ogmb = (ogmb + 1) % OGMB_CNT;
}
restore_flags (flags);