[svn-commits] sruffell: linux/trunk r9602 - /linux/trunk/drivers/dahdi/dahdi-base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jan 3 18:27:48 UTC 2011


Author: sruffell
Date: Mon Jan  3 12:27:44 2011
New Revision: 9602

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9602
Log:
dahdi: Only check for NOSTDTXRX once in dahdi_receive.

There is no need to check the flag on the master channel when processing all
the slave channels.  Originally part of a patch kpfleming had floating around.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Signed-off-by: Kevin P. Fleming <kpfleming at digium.com>
Acked-by: Kinsey Moore <kmoore at digium.com>

Modified:
    linux/trunk/drivers/dahdi/dahdi-base.c

Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=9602&r1=9601&r2=9602
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Mon Jan  3 12:27:44 2011
@@ -8849,8 +8849,12 @@
 
 	for (x = 0; x < span->channels; x++) {
 		struct dahdi_chan *const chan = span->chans[x];
+		spin_lock(&chan->lock);
+		if (unlikely(chan->flags & DAHDI_FLAG_NOSTDTXRX)) {
+			spin_unlock(&chan->lock);
+			continue;
+		}
 		if (chan->master == chan) {
-			spin_lock(&chan->lock);
 			if (chan->nextslave) {
 				/* Must process each slave at the same time */
 				u_char data[DAHDI_CHUNKSIZE];
@@ -8862,16 +8866,14 @@
 					for (z = chan; z; z = z->nextslave) {
 						data[pos++] = z->readchunk[y];
 						if (pos == DAHDI_CHUNKSIZE) {
-							if (!(chan->flags & DAHDI_FLAG_NOSTDTXRX))
-								__dahdi_receive_chunk(chan, data);
+							__dahdi_receive_chunk(chan, data);
 							pos = 0;
 						}
 					}
 				}
 			} else {
 				/* Process a normal channel */
-				if (!(chan->flags & DAHDI_FLAG_NOSTDTXRX))
-					__dahdi_real_receive(chan);
+				__dahdi_real_receive(chan);
 			}
 			if (chan->itimer) {
 				chan->itimer -= DAHDI_CHUNKSIZE;
@@ -8916,8 +8918,8 @@
 #ifdef BUFFER_DEBUG
 			chan->statcount -= DAHDI_CHUNKSIZE;
 #endif
-			spin_unlock(&chan->lock);
-		}
+		}
+		spin_unlock(&chan->lock);
 	}
 
 	local_irq_restore(flags);




More information about the svn-commits mailing list