From 567a9becaa5e865726c9185c2eabfc14d902dc97 Mon Sep 17 00:00:00 2001 From: Matthew Fredrickson Date: Wed, 9 Jul 2008 06:34:56 +0000 Subject: 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 --- drivers/dahdi/dahdi-base.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'drivers') 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) { -- cgit v1.2.3