[svn-commits] rmeyerriecks: linux/trunk r9494 - /linux/trunk/drivers/dahdi/dahdi-base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Nov 19 11:34:48 CST 2010


Author: rmeyerriecks
Date: Fri Nov 19 11:34:42 2010
New Revision: 9494

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9494
Log:
dahdi: Fixup prior dahdi_mirror patch

Reworking tsearle's patch to fit with coding guidelines and make
process_masterspan a bit easier to read.

(closes issue #16831)
Reported by: tsearle
Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>
Acked-by: Shaun Ruffell <sruffell 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=9494&r1=9493&r2=9494
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Fri Nov 19 11:34:42 2010
@@ -8469,6 +8469,28 @@
 	return 0;
 }
 
+static inline void __pseudo_rx_audio(struct dahdi_chan *chan)
+{
+	unsigned char tmp[DAHDI_CHUNKSIZE];
+	spin_lock(&chan->lock);
+	__dahdi_getempty(chan, tmp);
+	__dahdi_receive_chunk(chan, tmp);
+	spin_unlock(&chan->lock);
+}
+
+#ifdef CONFIG_DAHDI_MIRROR
+static inline void pseudo_rx_audio(struct dahdi_chan *chan)
+{
+	if (!chan->srcmirror)
+		__pseudo_rx_audio(chan);
+}
+#else
+static inline void pseudo_rx_audio(struct dahdi_chan *chan)
+{
+	__pseudo_rx_audio(chan);
+}
+#endif /* CONFIG_DAHDI_MIRROR */
+
 static void process_masterspan(void)
 {
 	unsigned long flags;
@@ -8526,19 +8548,7 @@
 
 	/* do all the pseudo/conferenced channel transmits (putbuf's) */
 	list_for_each_entry(pseudo, &pseudo_chans, node) {
-		unsigned char tmp[DAHDI_CHUNKSIZE];
-		spin_lock(&pseudo->chan.lock);
-#ifdef CONFIG_DAHDI_MIRROR
-		// if this is a mirroring don't generate garbage
-		if(!pseudo->chan.srcmirror)
-		{
-#endif /* CONFIG_DAHDI_MIRROR */
-			__dahdi_getempty(&pseudo->chan, tmp);
-			__dahdi_receive_chunk(&pseudo->chan, tmp);
-#ifdef CONFIG_DAHDI_MIRROR
-		}
-#endif /* CONFIG_DAHDI_MIRROR */
-		spin_unlock(&pseudo->chan.lock);
+		pseudo_rx_audio(&pseudo->chan);
 	}
 
 	for (y = 1; y < maxspans; ++y) {




More information about the svn-commits mailing list