[svn-commits] sruffell: branch linux/sruffell/chan_list_refactoring r9270 - /linux/team/sru...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Sep 2 12:41:13 CDT 2010


Author: sruffell
Date: Thu Sep  2 12:41:02 2010
New Revision: 9270

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9270
Log:
dahdi: Reduce 'chans' dereferencing in dahdi_check_conf

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

Modified: linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c?view=diff&rev=9270&r1=9269&r2=9270
==============================================================================
--- linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c Thu Sep  2 12:41:02 2010
@@ -923,12 +923,14 @@
 		return;
 
 	for (y = 0; y < maxchans; y++) {
-		if (chans[y] && (chans[y]->confna == x) &&
-				((chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONF ||
-				(chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFANN ||
-				(chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFMON ||
-				(chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_CONFANNMON ||
-				(chans[y]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_REALANDPSEUDO)) {
+		struct dahdi_chan *const chan = chans[y];
+		const int confmode = chan->confmode & DAHDI_CONF_MODE_MASK;
+		if (chan && (chan->confna == x) &&
+		    (confmode == DAHDI_CONF_CONF ||
+		     confmode == DAHDI_CONF_CONFANN ||
+		     confmode == DAHDI_CONF_CONFMON ||
+		     confmode == DAHDI_CONF_CONFANNMON ||
+		     confmode == DAHDI_CONF_REALANDPSEUDO)) {
 			return;
 		}
 	}




More information about the svn-commits mailing list