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

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


Author: sruffell
Date: Thu Sep  2 12:41:05 2010
New Revision: 9273

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9273
Log:
dahdi: Add valid_channo helper function.

Sometimes you want to check the channo without actually returning from
the calling function as is done in VALID_CHANNEL.

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=9273&r1=9272&r2=9273
==============================================================================
--- 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:05 2010
@@ -3635,8 +3635,14 @@
 	}
 }
 
+static bool valid_channo(const int channo)
+{
+	return ((channo >= DAHDI_MAX_CHANNELS) || (channo < 1)) ?
+			false : true;
+}
+
 #define VALID_CHANNEL(j) do { \
-	if ((j >= DAHDI_MAX_CHANNELS) || (j < 1)) \
+	if (!valid_channo(j)) \
 		return -EINVAL; \
 	if (!chans[j]) \
 		return -ENXIO; \




More information about the svn-commits mailing list