[zaptel-commits] kpfleming: branch 1.2 r2188 - /branches/1.2/zaptel-base.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Tue Feb 20 21:25:22 MST 2007


Author: kpfleming
Date: Tue Feb 20 22:25:21 2007
New Revision: 2188

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2188
Log:
fix up some compiler warnings when building for 2.4 kernels

Modified:
    branches/1.2/zaptel-base.c

Modified: branches/1.2/zaptel-base.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/zaptel-base.c?view=diff&rev=2188&r1=2187&r2=2188
==============================================================================
--- branches/1.2/zaptel-base.c (original)
+++ branches/1.2/zaptel-base.c Tue Feb 20 22:25:21 2007
@@ -2340,26 +2340,30 @@
 static int zt_open(struct inode *inode, struct file *file)
 {
 	int unit = UNIT(file);
-	int ret = -ENXIO;
 	struct zt_chan *chan;
+
 	/* Minor 0: Special "control" descriptor */
 	if (!unit) 
 		return zt_ctl_open(inode, file);
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 	if (unit == 250) {
 		if (!zt_transcode_fops)
 			request_module("zttranscode");
 		if (zt_transcode_fops && zt_transcode_fops->open) {
 			if (try_module_get(zt_transcode_fops->owner)) {
+				int ret;
+
 				ret = zt_transcode_fops->open(inode, file);
 				if (ret)
 					module_put(zt_transcode_fops->owner);
-			}
-			return ret;
+				return ret;
+			}
 		}
 		return -ENXIO;
 	}
 #endif
+
 	if (unit == 253) {
 		if (maxspans) {
 			return zt_timing_open(inode, file);
@@ -6166,11 +6170,13 @@
 
 static int zt_mmap(struct file *file, struct vm_area_struct *vm)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 	int unit = UNIT(file);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+
 	if (unit == 250)
 		return zt_transcode_fops->mmap(file, vm);
 #endif
+
 	return -ENOSYS;
 }
 



More information about the zaptel-commits mailing list