[svn-commits] sruffell: branch linux/sruffell/chan_list r9339 - /linux/team/sruffell/chan_l...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Sep 17 14:11:49 CDT 2010


Author: sruffell
Date: Fri Sep 17 14:11:38 2010
New Revision: 9339

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9339
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>

Modified:
    linux/team/sruffell/chan_list/drivers/dahdi/dahdi-base.c

Modified: linux/team/sruffell/chan_list/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/chan_list/drivers/dahdi/dahdi-base.c?view=diff&rev=9339&r1=9338&r2=9339
==============================================================================
--- linux/team/sruffell/chan_list/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/sruffell/chan_list/drivers/dahdi/dahdi-base.c Fri Sep 17 14:11:38 2010
@@ -8771,8 +8771,12 @@
 #endif
 	for (x = 0; x < span->channels; x++) {
 		struct dahdi_chan *const chan = span->chans[x];
+		spin_lock_irqsave(&chan->lock, flags);
+		if (unlikely(chan->flags & DAHDI_FLAG_NOSTDTXRX)) {
+			spin_unlock_irqrestore(&chan->lock, flags);
+			continue;
+		}
 		if (chan->master == chan) {
-			spin_lock_irqsave(&chan->lock, flags);
 			if (chan->nextslave) {
 				/* Must process each slave at the same time */
 				u_char data[DAHDI_CHUNKSIZE];
@@ -8784,16 +8788,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;
@@ -8839,7 +8841,9 @@
 			chan->statcount -= DAHDI_CHUNKSIZE;
 #endif
 			spin_unlock_irqrestore(&chan->lock, flags);
-		}
+			continue;
+		}
+		spin_unlock_irqrestore(&chan->lock, flags);
 	}
 
 	if (span == master)




More information about the svn-commits mailing list