summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMatthew Fredrickson <creslin@digium.com>2008-07-09 06:34:56 +0000
committerMatthew Fredrickson <creslin@digium.com>2008-07-09 06:34:56 +0000
commit567a9becaa5e865726c9185c2eabfc14d902dc97 (patch)
tree045ecfdbf52bc2e065d2027559dd27b22d173f6f /drivers
parent175f6b085ab0a37299ba3882f542d138fb6ca25a (diff)
Revert optimization done in rev 4436 which broke the MTP2 signalling type.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4582 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dahdi/dahdi-base.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index fd1ad8f..5f9de80 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -6801,15 +6801,20 @@ static inline void __putbuf_chunk(struct dahdi_chan *ss, unsigned char *rxb, int
* have messed around with it since then */
int comparemessage;
+ /* Shut compiler up */
+ int myres = 0;
if (ms->flags & DAHDI_FLAG_MTP2) {
comparemessage = (ms->inreadbuf - 1) & (ms->numbufs - 1);
- if (!memcmp(ms->readbuf[comparemessage], ms->readbuf[ms->inreadbuf], ms->readn[ms->inreadbuf])) {
- /* Our messages are the same, so discard -
- * Don't advance buffers, reset indexes and buffer sizes. */
- ms->readn[ms->inreadbuf] = 0;
- ms->readidx[ms->inreadbuf] = 0;
- }
+
+ myres = memcmp(ms->readbuf[comparemessage], ms->readbuf[ms->inreadbuf], ms->readn[ms->inreadbuf]);
+ }
+
+ if ((ms->flags & DAHDI_FLAG_MTP2) && !myres) {
+ /* Our messages are the same, so discard -
+ * Don't advance buffers, reset indexes and buffer sizes. */
+ ms->readn[ms->inreadbuf] = 0;
+ ms->readidx[ms->inreadbuf] = 0;
} else {
ms->inreadbuf = (ms->inreadbuf + 1) % ms->numbufs;
if (ms->inreadbuf == ms->outreadbuf) {