[svn-commits] sruffell: linux/trunk r9468 - in /linux/trunk: drivers/dahdi/ include/dahdi/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Nov 4 11:40:53 CDT 2010


Author: sruffell
Date: Thu Nov  4 11:40:49 2010
New Revision: 9468

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9468
Log:
dahdi: Constify the dahdi_txlevelnames and return of dahdi_lboname().

Also moves the dahdi_txlevelnames array into the dahdi_lboname function,
which is the only place it it used.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

Modified:
    linux/trunk/drivers/dahdi/dahdi-base.c
    linux/trunk/include/dahdi/kernel.h

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=9468&r1=9467&r2=9468
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Thu Nov  4 11:40:49 2010
@@ -96,18 +96,6 @@
 /* macro-oni for determining a unit (channel) number */
 #define	UNIT(file) MINOR(file->f_dentry->d_inode->i_rdev)
 
-/* names of tx level settings */
-static char *dahdi_txlevelnames[] = {
-"0 db (CSU)/0-133 feet (DSX-1)",
-"133-266 feet (DSX-1)",
-"266-399 feet (DSX-1)",
-"399-533 feet (DSX-1)",
-"533-655 feet (DSX-1)",
-"-7.5db (CSU)",
-"-15db (CSU)",
-"-22.5db (CSU)"
-} ;
-
 EXPORT_SYMBOL(dahdi_transcode_fops);
 EXPORT_SYMBOL(dahdi_init_tone_state);
 EXPORT_SYMBOL(dahdi_mf_tone);
@@ -122,7 +110,6 @@
 EXPORT_SYMBOL(__dahdi_lin2mu);
 EXPORT_SYMBOL(__dahdi_lin2a);
 #endif
-EXPORT_SYMBOL(dahdi_lboname);
 EXPORT_SYMBOL(dahdi_transmit);
 EXPORT_SYMBOL(dahdi_receive);
 EXPORT_SYMBOL(dahdi_rbsbits);
@@ -1636,12 +1623,29 @@
 	return 0;
 }
 
-char *dahdi_lboname(int x)
-{
-	if ((x < 0) || (x > 7))
+/**
+ * dahdi_lboname() - Convert line build out number to string.
+ *
+ */
+const char *dahdi_lboname(int lbo)
+{
+	/* names of tx level settings */
+	static const char *const dahdi_txlevelnames[] = {
+		"0 db (CSU)/0-133 feet (DSX-1)",
+		"133-266 feet (DSX-1)",
+		"266-399 feet (DSX-1)",
+		"399-533 feet (DSX-1)",
+		"533-655 feet (DSX-1)",
+		"-7.5db (CSU)",
+		"-15db (CSU)",
+		"-22.5db (CSU)"
+	};
+
+	if ((lbo < 0) || (lbo > 7))
 		return "Unknown";
-	return dahdi_txlevelnames[x];
-}
+	return dahdi_txlevelnames[lbo];
+}
+EXPORT_SYMBOL(dahdi_lboname);
 
 #if defined(CONFIG_DAHDI_NET) || defined(CONFIG_DAHDI_PPP)
 static inline void print_debug_writebuf(struct dahdi_chan* ss, struct sk_buff *skb, int oldbuf)

Modified: linux/trunk/include/dahdi/kernel.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/include/dahdi/kernel.h?view=diff&rev=9468&r1=9467&r2=9468
==============================================================================
--- linux/trunk/include/dahdi/kernel.h (original)
+++ linux/trunk/include/dahdi/kernel.h Thu Nov  4 11:40:49 2010
@@ -1060,7 +1060,7 @@
 int dahdi_unregister(struct dahdi_span *span);
 
 /*! \brief Gives a name to an LBO */
-char *dahdi_lboname(int lbo);
+const char *dahdi_lboname(int lbo);
 
 /*! \brief Tell DAHDI about changes in received rbs bits */
 void dahdi_rbsbits(struct dahdi_chan *chan, int bits);




More information about the svn-commits mailing list