[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH gnumach 16/16] Fix undefined operation on assigning self pre-incr
From: |
Guillem Jover |
Subject: |
[PATCH gnumach 16/16] Fix undefined operation on assigning self pre-incremented variable |
Date: |
Tue, 30 Aug 2011 03:09:42 +0200 |
* 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.
---
linux/src/drivers/net/de4x5.c | 20 ++++++++++----------
linux/src/drivers/net/depca.c | 8 ++++----
linux/src/drivers/scsi/wd7000.c | 2 +-
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);
--
1.7.5.4
- [PATCH gnumach 02/16] Return a value on non-void function, (continued)
- [PATCH gnumach 02/16] Return a value on non-void function, Guillem Jover, 2011/08/29
- [PATCH gnumach 14/16] Correct MiG Mach types to fix compilation warnings, Guillem Jover, 2011/08/29
- [PATCH gnumach 12/16] Move <linux/init.h> from linux/pcmcia-cs to linux/src, Guillem Jover, 2011/08/29
- [PATCH gnumach 07/16] Add linux_timer_intr function declaration, Guillem Jover, 2011/08/29
- [PATCH gnumach 04/16] Cast host_get_time() arguments to fix warnings, Guillem Jover, 2011/08/29
- [PATCH gnumach 16/16] Fix undefined operation on assigning self pre-incremented variable,
Guillem Jover <=
- [PATCH gnumach 06/16] Add missing headers, Guillem Jover, 2011/08/29
- [PATCH gnumach 10/16] Import Linux 3.1 ctype code, Guillem Jover, 2011/08/29
- [PATCH gnumach 09/16] Remove unused and non-functional string specialization header, Guillem Jover, 2011/08/29
- [PATCH gnumach 15/16] Honour type promotion on variable argument handling, Guillem Jover, 2011/08/29
- [PATCH gnumach 11/16] Import Linux 3.1 compiler definitions, Guillem Jover, 2011/08/29