summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-06-29 20:20:20 +0000
committerShaun Ruffell <sruffell@digium.com>2010-06-29 20:20:20 +0000
commite421d2712f10b1bff80ac63a441f4513dd6a9260 (patch)
treea2f887b32dd1921f9c421d3aefa78bcaaaa4d75d
parente34e04b441aadf5296bd7469d5fd7c06773df741 (diff)
wctdm24xxp, wcte12xp: Fix "operation on may be undefined" warning.
gcc 4.5.0 generates a warning on the changed lines and http://gcc.gnu.org/ml/gcc/2004-10/msg00032.html explains why. Essentially, the only thing guaranteed with the preincrement operator is that the value will be incremented before the assignment. It's undefined where in the sequence the mask will be applied. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8832 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/voicebus/voicebus.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/dahdi/voicebus/voicebus.c b/drivers/dahdi/voicebus/voicebus.c
index 8e50332..eeceddc 100644
--- a/drivers/dahdi/voicebus/voicebus.c
+++ b/drivers/dahdi/voicebus/voicebus.c
@@ -614,7 +614,7 @@ int voicebus_transmit(struct voicebus *vb, struct vbb *vbb)
dl->pending[dl->tail] = vbb;
d->buffer1 = dma_map_single(&vb->pdev->dev, vbb->data,
sizeof(vbb->data), DMA_TO_DEVICE);
- dl->tail = (++(dl->tail)) & DRING_MASK;
+ dl->tail = (dl->tail + 1) & DRING_MASK;
SET_OWNED(d); /* That's it until the hardware is done with it. */
atomic_inc(&dl->count);
return 0;
@@ -1309,7 +1309,7 @@ static void vb_tasklet_normal(unsigned long data)
if (d->buffer1 != vb->idle_vbb_dma_addr)
goto tx_error_exit;
SET_OWNED(d);
- dl->head = ++dl->head & DRING_MASK;
+ dl->head = (dl->head + 1) & DRING_MASK;
d = vb_descriptor(dl, dl->head);
++behind;
}
@@ -1334,7 +1334,7 @@ static void vb_tasklet_normal(unsigned long data)
if (d->buffer1 != vb->idle_vbb_dma_addr)
goto tx_error_exit;
SET_OWNED(d);
- dl->head = ++dl->head & DRING_MASK;
+ dl->head = (dl->head + 1) & DRING_MASK;
d = vb_descriptor(dl, dl->head);
++behind;
}
@@ -1344,7 +1344,7 @@ static void vb_tasklet_normal(unsigned long data)
d->buffer1 = vb->idle_vbb_dma_addr;
dl->pending[dl->head] = vb->idle_vbb;
d->des0 |= OWN_BIT;
- dl->head = ++dl->head & DRING_MASK;
+ dl->head = (dl->head + 1) & DRING_MASK;
}
dl->tail = dl->head;
}