[svn-commits] sruffell: branch linux/kpfleming/echocan_work r6370 - in /linux/team/kpflemin...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Apr 15 15:12:54 CDT 2009


Author: sruffell
Date: Wed Apr 15 15:12:50 2009
New Revision: 6370

URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=6370
Log:
Fix errors reported by checkpatch.pl in recent changes.

Modified:
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_jpah.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_kb1.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_mg2.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_oslec.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec2.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/dahdi_echocan_hpec.c

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c?view=diff&rev=6370&r1=6369&r2=6370
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c Wed Apr 15 15:12:50 2009
@@ -379,7 +379,7 @@
 #ifdef DEFINE_RWLOCK
 static DEFINE_RWLOCK(ecfactory_list_lock);
 #else
-static rwlock_t ecfactory_list_lock = RW_LOCK_UNLOCKED;
+static rwlock_t ecfactory_list_lock = __RW_LOCK_UNLOCKED();
 #endif
 
 static LIST_HEAD(ecfactory_list);
@@ -4949,7 +4949,8 @@
 		   an echo canceler instance if possible */
 		ec_current = chan->ec_factory;
 
-		if ((ret = ec_current->echocan_create(ecp, params, &ec))) {
+		ret = ec_current->echocan_create(ecp, params, &ec);
+		if (ret)
 			release_echocan(ec_current);
 
 			goto exit_with_free;

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_jpah.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_jpah.c?view=diff&rev=6370&r1=6369&r2=6370
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_jpah.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_jpah.c Wed Apr 15 15:12:50 2009
@@ -75,9 +75,9 @@
 		return -EINVAL;
 	}
 
-	if (!(pvt = kzalloc(sizeof(*pvt), GFP_KERNEL))) {
+	pvt = kzalloc(sizeof(*pvt), GFP_KERNEL);
+	if (!pvt)
 		return -ENOMEM;
-	}
 
 	pvt->dahdi.ops = &my_ops;
 

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_kb1.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_kb1.c?view=diff&rev=6370&r1=6369&r2=6370
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_kb1.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_kb1.c Wed Apr 15 15:12:50 2009
@@ -256,7 +256,7 @@
 	return cb->buf_d[cb->idx_d + pos];
 }
 
-static inline void init_cc(struct ec_pvt *pvt, int N, int maxy, int maxu) 
+static inline void init_cc(struct ec_pvt *pvt, int N, int maxy, int maxu)
 {
 	void *ptr = pvt;
 	unsigned long tmp;
@@ -328,7 +328,7 @@
 	kfree(pvt);
 }
 
-static inline short sample_update(struct ec_pvt *pvt, short iref, short isig) 
+static inline short sample_update(struct ec_pvt *pvt, short iref, short isig)
 {
 	/* Declare local variables that are used more than once */
 	/* ... */
@@ -357,7 +357,7 @@
 	/* Update the Far-end receive signal circular buffers and accumulators */
 	/* ------------------------------------------------------------------- */
 	/* Delete the oldest sample from the power estimate accumulator */
-	pvt->y_tilde_i -= abs(get_cc_s(&pvt->y_s, (1 << DEFAULT_ALPHA_YT_I) - 1 )) >> DEFAULT_ALPHA_YT_I;
+	pvt->y_tilde_i -= abs(get_cc_s(&pvt->y_s, (1 << DEFAULT_ALPHA_YT_I) - 1)) >> DEFAULT_ALPHA_YT_I;
 	/* Add the new sample to the power estimate accumulator */
 	pvt->y_tilde_i += abs(iref) >> DEFAULT_ALPHA_ST_I;
 	/* Push a copy of the new sample into its circular buffer */
@@ -365,8 +365,8 @@
  
 
 	/* eq. (2): compute r in fixed-point */
-	rs = CONVOLVE2(pvt->a_s, 
-		       pvt->y_s.buf_d + pvt->y_s.idx_d, 
+	rs = CONVOLVE2(pvt->a_s,
+		       pvt->y_s.buf_d + pvt->y_s.idx_d,
 		       pvt->N_d);
 	rs >>= 15;
 
@@ -383,7 +383,7 @@
 	/* Update the Near-end hybrid signal circular buffers and accumulators */
 	/* ------------------------------------------------------------------- */
 	/* Delete the oldest sample from the power estimate accumulator */
-	pvt->s_tilde_i -= abs(get_cc_s(&pvt->s_s, (1 << DEFAULT_ALPHA_ST_I) - 1 ));
+	pvt->s_tilde_i -= abs(get_cc_s(&pvt->s_s, (1 << DEFAULT_ALPHA_ST_I) - 1));
 	/* Add the new sample to the power estimate accumulator */
 	pvt->s_tilde_i += abs(isig);
 	/* Push a copy of the new sample into it's circular buffer */
@@ -391,7 +391,7 @@
 
 
 	/* Push a copy of the current short-time average of the far-end receive signal into it's circular buffer */
-	add_cc_s(&pvt->y_tilde_s, pvt->y_tilde_i);		
+	add_cc_s(&pvt->y_tilde_s, pvt->y_tilde_i);
 
 	/* flow B on pg. 428 */
   
@@ -411,8 +411,8 @@
 	 * Still needs conversion!
 	 */
 
-	if (pvt->start_speech_d != 0 ){
-		if ( pvt->i_d > (DEFAULT_T0 + pvt->start_speech_d)*(SAMPLE_FREQ) ){
+	if (pvt->start_speech_d != 0) {
+		if (pvt->i_d > (DEFAULT_T0 + pvt->start_speech_d)*(SAMPLE_FREQ)) {
 			pvt->beta2_d = max_cc_float(MIN_BETA, DEFAULT_BETA1 * exp((-1/DEFAULT_TAU)*((pvt->i_d/(float)SAMPLE_FREQ) - DEFAULT_T0 - pvt->start_speech_d)));
 		}
 	} else {
@@ -421,17 +421,17 @@
 #endif
   
 	/* Fixed point, inverted */
-	pvt->beta2_i = DEFAULT_BETA1_I;	
+	pvt->beta2_i = DEFAULT_BETA1_I;
   
 	/* Fixed point version, inverted */
-	two_beta_i = (pvt->beta2_i * Py_i) >> 15;	
+	two_beta_i = (pvt->beta2_i * Py_i) >> 15;
 	if (!two_beta_i)
 		two_beta_i++;
 
 	/* Update the Suppressed signal power estimate accumulator */
         /* ------------------------------------------------------- */
         /* Delete the oldest sample from the power estimate accumulator */
-	pvt->Lu_i -= abs(get_cc_s(&pvt->u_s, (1 << DEFAULT_SIGMA_LU_I) - 1 )) ;
+	pvt->Lu_i -= abs(get_cc_s(&pvt->u_s, (1 << DEFAULT_SIGMA_LU_I) - 1));
         /* Add the new sample to the power estimate accumulator */
 	pvt->Lu_i += abs(u);
 
@@ -460,7 +460,7 @@
 
 	/* Determine if near end speech was detected in this sample */
 	/* -------------------------------------------------------- */
-	if (((pvt->s_tilde_i >> (DEFAULT_ALPHA_ST_I - 1)) > pvt->max_y_tilde) 
+	if (((pvt->s_tilde_i >> (DEFAULT_ALPHA_ST_I - 1)) > pvt->max_y_tilde)
 	    && (pvt->max_y_tilde > 0))  {
 		/* Then start the Hangover counter */
 		pvt->HCNTR_d = DEFAULT_HANGT;
@@ -487,13 +487,13 @@
 		if (pvt->Lu_i > MIN_UPDATE_THRESH_I) {	/* there is sufficient energy above the noise floor to contain meaningful data */
   							/* so loop over all the filter coefficients */
 #ifdef MEC2_STATS_DETAILED
-			printk( KERN_INFO "updating coefficients with: pvt->Lu_i %9d\n", pvt->Lu_i);
-#endif
-#ifdef MEC2_STATS
-			pvt->avg_Lu_i_ok = pvt->avg_Lu_i_ok + pvt->Lu_i;  
+			printk(KERN_INFO "updating coefficients with: pvt->Lu_i %9d\n", pvt->Lu_i);
+#endif
+#ifdef MEC2_STATS
+			pvt->avg_Lu_i_ok = pvt->avg_Lu_i_ok + pvt->Lu_i;
 			++pvt->cntr_coeff_updates;
 #endif
-			for (k=0; k < pvt->N_d; k++) {
+			for (k = 0; k < pvt->N_d; k++) {
 				/* eq. (7): compute an expectation over M_d samples */
 				int grad2;
 				grad2 = CONVOLVE2(pvt->u_s.buf_d + pvt->u_s.idx_d,
@@ -503,12 +503,12 @@
 				pvt->a_i[k] += grad2 / two_beta_i;
 				pvt->a_s[k] = pvt->a_i[k] >> 16;
 			}
-		} else { 
+		} else {
 #ifdef MEC2_STATS_DETAILED
-			printk( KERN_INFO "insufficient signal to update coefficients pvt->Lu_i %5d < %5d\n", pvt->Lu_i, MIN_UPDATE_THRESH_I);
-#endif
-#ifdef MEC2_STATS
-			pvt->avg_Lu_i_toolow = pvt->avg_Lu_i_toolow + pvt->Lu_i;  
+			printk(KERN_INFO "insufficient signal to update coefficients pvt->Lu_i %5d < %5d\n", pvt->Lu_i, MIN_UPDATE_THRESH_I);
+#endif
+#ifdef MEC2_STATS
+			pvt->avg_Lu_i_toolow = pvt->avg_Lu_i_toolow + pvt->Lu_i;
 			++pvt->cntr_coeff_missedupdates;
 #endif
 		}
@@ -520,7 +520,7 @@
 	 */
 #ifdef MEC2_STATS_DETAILED
 	if (pvt->HCNTR_d == 0)
-		printk( KERN_INFO "possibily correcting frame with pvt->Ly_i %9d pvt->Lu_i %9d and expression %d\n", pvt->Ly_i, pvt->Lu_i, (pvt->Ly_i/(pvt->Lu_i + 1)));
+		printk(KERN_INFO "possibily correcting frame with pvt->Ly_i %9d pvt->Lu_i %9d and expression %d\n", pvt->Ly_i, pvt->Lu_i, (pvt->Ly_i/(pvt->Lu_i + 1)));
 #endif
 
 #ifndef NO_ECHO_SUPPRESSOR
@@ -530,20 +530,20 @@
 				u = u * (pvt->Lu_i >> DEFAULT_SIGMA_LU_I) / ((pvt->Ly_i >> (DEFAULT_SIGMA_LY_I)) + 1);
 			}
 #ifdef MEC2_STATS_DETAILED
-			printk( KERN_INFO "aggresively correcting frame with pvt->Ly_i %9d pvt->Lu_i %9d expression %d\n", pvt->Ly_i, pvt->Lu_i, (pvt->Ly_i/(pvt->Lu_i + 1)));
+			printk(KERN_INFO "aggresively correcting frame with pvt->Ly_i %9d pvt->Lu_i %9d expression %d\n", pvt->Ly_i, pvt->Lu_i, (pvt->Ly_i/(pvt->Lu_i + 1)));
 #endif
 #ifdef MEC2_STATS
 			++pvt->cntr_residualcorrected_frames;
 #endif
 		}
 	} else {
-		if (pvt->HCNTR_d == 0) { 
+		if (pvt->HCNTR_d == 0) {
 			if ((pvt->Ly_i/(pvt->Lu_i + 1)) > DEFAULT_SUPPR_I) {
 				for (k=0; k < 1; k++) {
 					u = u * (pvt->Lu_i >> DEFAULT_SIGMA_LU_I) / ((pvt->Ly_i >> (DEFAULT_SIGMA_LY_I + 2)) + 1);
 				}
 #ifdef MEC2_STATS_DETAILED
-				printk( KERN_INFO "correcting frame with pvt->Ly_i %9d pvt->Lu_i %9d expression %d\n", pvt->Ly_i, pvt->Lu_i, (pvt->Ly_i/(pvt->Lu_i + 1)));
+				printk(KERN_INFO "correcting frame with pvt->Ly_i %9d pvt->Lu_i %9d expression %d\n", pvt->Ly_i, pvt->Lu_i, (pvt->Ly_i/(pvt->Lu_i + 1)));
 #endif
 #ifdef MEC2_STATS
 				++pvt->cntr_residualcorrected_frames;
@@ -560,10 +560,10 @@
 
 #if 0
 	/* This will generate a non-linear supression factor, once converted */
-	if ((pvt->HCNTR_d == 0) && 
-	    ((pvt->Lu_d/pvt->Ly_d) < DEFAULT_SUPPR) &&
-	    (pvt->Lu_d/pvt->Ly_d > EC_MIN_DB_VALUE)) { 
-	    	suppr_factor = (10 / (float)(SUPPR_FLOOR - SUPPR_CEIL)) * log(pvt->Lu_d/pvt->Ly_d)
+	if ((pvt->HCNTR_d == 0) &&
+		((pvt->Lu_d/pvt->Ly_d) < DEFAULT_SUPPR) &&
+		(pvt->Lu_d/pvt->Ly_d > EC_MIN_DB_VALUE)) {
+			suppr_factor = (10 / (float)(SUPPR_FLOOR - SUPPR_CEIL)) * log(pvt->Lu_d/pvt->Ly_d)
 			- SUPPR_CEIL / (float)(SUPPR_FLOOR - SUPPR_CEIL);
 		u_suppr = pow(10.0, (suppr_factor) * RES_SUPR_FACTOR / 10.0) * u_suppr;
 	}
@@ -585,9 +585,9 @@
 
 		printk( KERN_INFO "%d: Near end speech: %5d Residuals corrected/skipped: %5d/%5d Coefficients updated ok/low sig: %3d/%3d Lu_i avg ok/low sig %6d/%5d\n", 
 			pvt->id,
-			pvt->cntr_nearend_speech_frames, 
-			pvt->cntr_residualcorrected_frames, pvt->cntr_residualcorrected_framesskipped, 
-			pvt->cntr_coeff_updates, pvt->cntr_coeff_missedupdates, 
+			pvt->cntr_nearend_speech_frames,
+			pvt->cntr_residualcorrected_frames, pvt->cntr_residualcorrected_framesskipped,
+			pvt->cntr_coeff_updates, pvt->cntr_coeff_missedupdates,
 			pvt->avg_Lu_i_ok, pvt->avg_Lu_i_toolow);
 
 		pvt->cntr_nearend_speech_frames = 0;
@@ -646,9 +646,9 @@
 		2 * sizeof(short) * (maxu) +			/* u_s */
 		2 * sizeof(short) * ecp->tap_length;		/* y_tilde_s */
 
-	if (!(pvt = kzalloc(size, GFP_KERNEL))) {
+	pvt = kzalloc(size, GFP_KERNEL);
+	if (!pvt)
 		return -ENOMEM;
-	}
 
 	pvt->dahdi.ops = &my_ops;
 

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_mg2.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_mg2.c?view=diff&rev=6370&r1=6369&r2=6370
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_mg2.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_mg2.c Wed Apr 15 15:12:50 2009
@@ -52,7 +52,7 @@
 #define RESTORE_COEFFS {\
 				int x;\
 				memcpy(pvt->a_i, pvt->c_i, pvt->N_d*sizeof(int));\
-				for (x=0;x<pvt->N_d;x++) {\
+				for (x = 0; x < pvt->N_d; x++) {\
 					pvt->a_s[x] = pvt->a_i[x] >> 16;\
 				}\
 				pvt->backup = BACKUP;\
@@ -297,7 +297,7 @@
 	return cb->buf_d[cb->idx_d + pos];
 }
 
-static inline void init_cc(struct ec_pvt *pvt, int N, int maxy, int maxu) 
+static inline void init_cc(struct ec_pvt *pvt, int N, int maxy, int maxu)
 {
 	void *ptr = pvt;
 	unsigned long tmp;
@@ -386,7 +386,7 @@
 }
 #endif
 
-static inline short sample_update(struct ec_pvt *pvt, short iref, short isig) 
+static inline short sample_update(struct ec_pvt *pvt, short iref, short isig)
 {
 	/* Declare local variables that are used more than once */
 	/* ... */
@@ -419,7 +419,7 @@
 	/* Update the Far-end receive signal circular buffers and accumulators */
 	/* ------------------------------------------------------------------- */
 	/* Delete the oldest sample from the power estimate accumulator */
-	pvt->y_tilde_i -= abs(get_cc_s(&pvt->y_s, (1 << DEFAULT_ALPHA_YT_I) - 1 )) >> DEFAULT_ALPHA_YT_I;
+	pvt->y_tilde_i -= abs(get_cc_s(&pvt->y_s, (1 << DEFAULT_ALPHA_YT_I) - 1)) >> DEFAULT_ALPHA_YT_I;
 	/* Add the new sample to the power estimate accumulator */
 	pvt->y_tilde_i += abs(iref) >> DEFAULT_ALPHA_ST_I;
 	/* Push a copy of the new sample into its circular buffer */
@@ -427,8 +427,8 @@
  
 
 	/* eq. (2): compute r in fixed-point */
-	rs = CONVOLVE2(pvt->a_s, 
-		       pvt->y_s.buf_d + pvt->y_s.idx_d, 
+	rs = CONVOLVE2(pvt->a_s,
+		       pvt->y_s.buf_d + pvt->y_s.idx_d,
 		       pvt->N_d);
 	rs >>= 15;
 
@@ -482,8 +482,8 @@
 	if (!pvt->backup) {
 		/* Backup coefficients periodically */
 		pvt->backup = BACKUP;
-		memcpy(pvt->c_i,pvt->b_i,pvt->N_d*sizeof(int));
-		memcpy(pvt->b_i,pvt->a_i,pvt->N_d*sizeof(int));
+		memcpy(pvt->c_i, pvt->b_i, pvt->N_d*sizeof(int));
+		memcpy(pvt->b_i, pvt->a_i, pvt->N_d*sizeof(int));
 	} else
 		pvt->backup--;
 
@@ -491,7 +491,7 @@
 	/* Update the Near-end hybrid signal circular buffers and accumulators */
 	/* ------------------------------------------------------------------- */
 	/* Delete the oldest sample from the power estimate accumulator */
-	pvt->s_tilde_i -= abs(get_cc_s(&pvt->s_s, (1 << DEFAULT_ALPHA_ST_I) - 1 ));
+	pvt->s_tilde_i -= abs(get_cc_s(&pvt->s_s, (1 << DEFAULT_ALPHA_ST_I) - 1));
 	/* Add the new sample to the power estimate accumulator */
 	pvt->s_tilde_i += abs(isig);
 	/* Push a copy of the new sample into it's circular buffer */
@@ -499,7 +499,7 @@
 
 
 	/* Push a copy of the current short-time average of the far-end receive signal into it's circular buffer */
-	add_cc_s(&pvt->y_tilde_s, pvt->y_tilde_i);		
+	add_cc_s(&pvt->y_tilde_s, pvt->y_tilde_i);
 
 	/* flow B on pg. 428 */
   
@@ -519,8 +519,8 @@
 	 * Still needs conversion!
 	 */
 
-	if (pvt->start_speech_d != 0 ){
-		if ( pvt->i_d > (DEFAULT_T0 + pvt->start_speech_d)*(SAMPLE_FREQ) ){
+	if (pvt->start_speech_d != 0) {
+		if (pvt->i_d > (DEFAULT_T0 + pvt->start_speech_d)*(SAMPLE_FREQ)) {
 			pvt->beta2_d = max_cc_float(MIN_BETA, DEFAULT_BETA1 * exp((-1/DEFAULT_TAU)*((pvt->i_d/(float)SAMPLE_FREQ) - DEFAULT_T0 - pvt->start_speech_d)));
 		}
 	} else {
@@ -529,17 +529,17 @@
 #endif
   
 	/* Fixed point, inverted */
-	pvt->beta2_i = DEFAULT_BETA1_I;	
+	pvt->beta2_i = DEFAULT_BETA1_I;
   
 	/* Fixed point version, inverted */
-	two_beta_i = (pvt->beta2_i * Py_i) >> 15;	
+	two_beta_i = (pvt->beta2_i * Py_i) >> 15;
 	if (!two_beta_i)
 		two_beta_i++;
 
 	/* Update the Suppressed signal power estimate accumulator */
         /* ------------------------------------------------------- */
         /* Delete the oldest sample from the power estimate accumulator */
-	pvt->Lu_i -= abs(get_cc_s(&pvt->u_s, (1 << DEFAULT_SIGMA_LU_I) - 1 )) ;
+	pvt->Lu_i -= abs(get_cc_s(&pvt->u_s, (1 << DEFAULT_SIGMA_LU_I) - 1));
         /* Add the new sample to the power estimate accumulator */
 	pvt->Lu_i += abs(u);
 
@@ -568,7 +568,7 @@
 
 	/* Determine if near end speech was detected in this sample */
 	/* -------------------------------------------------------- */
-	if (((pvt->s_tilde_i >> (DEFAULT_ALPHA_ST_I - 1)) > pvt->max_y_tilde) 
+	if (((pvt->s_tilde_i >> (DEFAULT_ALPHA_ST_I - 1)) > pvt->max_y_tilde)
 	    && (pvt->max_y_tilde > 0))  {
 		/* Then start the Hangover counter */
 		pvt->HCNTR_d = DEFAULT_HANGT;
@@ -606,10 +606,10 @@
 			printk(KERN_INFO "updating coefficients with: pvt->Lu_i %9d\n", pvt->Lu_i);
 #endif
 #ifdef MEC2_STATS
-			pvt->avg_Lu_i_ok = pvt->avg_Lu_i_ok + pvt->Lu_i;  
+			pvt->avg_Lu_i_ok = pvt->avg_Lu_i_ok + pvt->Lu_i;
 			++pvt->cntr_coeff_updates;
 #endif
-			for (k=0; k < pvt->N_d; k++) {
+			for (k = 0; k < pvt->N_d; k++) {
 				/* eq. (7): compute an expectation over M_d samples */
 				int grad2;
 				grad2 = CONVOLVE2(pvt->u_s.buf_d + pvt->u_s.idx_d,
@@ -639,16 +639,16 @@
 #ifdef USED_COEFFS
 			/* Filter out irrelevant coefficients */
 			if (pvt->N_d > USED_COEFFS)
-				for (k=0; k < pvt->N_d; k++)
+				for (k = 0; k < pvt->N_d; k++)
 					if (abs(pvt->a_i[k]) < max_coeffs[USED_COEFFS-1])
 						pvt->a_i[k] = pvt->a_s[k] = 0;
 #endif
-		} else { 
+		} else {
 #ifdef MEC2_STATS_DETAILED
 			printk(KERN_INFO "insufficient signal to update coefficients pvt->Lu_i %5d < %5d\n", pvt->Lu_i, MIN_UPDATE_THRESH_I);
 #endif
 #ifdef MEC2_STATS
-			pvt->avg_Lu_i_toolow = pvt->avg_Lu_i_toolow + pvt->Lu_i;  
+			pvt->avg_Lu_i_toolow = pvt->avg_Lu_i_toolow + pvt->Lu_i;
 			++pvt->cntr_coeff_missedupdates;
 #endif
 		}
@@ -677,7 +677,7 @@
 #endif
 		}
 	} else {
-		if (pvt->HCNTR_d == 0) { 
+		if (pvt->HCNTR_d == 0) {
 			if ((pvt->Ly_i/(pvt->Lu_i + 1)) > DEFAULT_SUPPR_I) {
 				for (k=0; k < 1; k++) {
 					u = u * (pvt->Lu_i >> DEFAULT_SIGMA_LU_I) / ((pvt->Ly_i >> (DEFAULT_SIGMA_LY_I + 2)) + 1);
@@ -700,10 +700,10 @@
 
 #if 0
 	/* This will generate a non-linear supression factor, once converted */
-	if ((pvt->HCNTR_d == 0) && 
-	    ((pvt->Lu_d/pvt->Ly_d) < DEFAULT_SUPPR) &&
-	    (pvt->Lu_d/pvt->Ly_d > EC_MIN_DB_VALUE)) { 
-	    	suppr_factor = (10 / (float)(SUPPR_FLOOR - SUPPR_CEIL)) * log(pvt->Lu_d/pvt->Ly_d)
+	if ((pvt->HCNTR_d == 0) &&
+		((pvt->Lu_d/pvt->Ly_d) < DEFAULT_SUPPR) &&
+		(pvt->Lu_d/pvt->Ly_d > EC_MIN_DB_VALUE)) {
+		suppr_factor = (10 / (float)(SUPPR_FLOOR - SUPPR_CEIL)) * log(pvt->Lu_d/pvt->Ly_d)
 			- SUPPR_CEIL / (float)(SUPPR_FLOOR - SUPPR_CEIL);
 		u_suppr = pow(10.0, (suppr_factor) * RES_SUPR_FACTOR / 10.0) * u_suppr;
 	}
@@ -725,9 +725,9 @@
 
 		printk(KERN_INFO "%d: Near end speech: %5d Residuals corrected/skipped: %5d/%5d Coefficients updated ok/low sig: %3d/%3d Lu_i avg ok/low sig %6d/%5d\n", 
 		       pvt->id,
-		       pvt->cntr_nearend_speech_frames, 
-		       pvt->cntr_residualcorrected_frames, pvt->cntr_residualcorrected_framesskipped, 
-		       pvt->cntr_coeff_updates, pvt->cntr_coeff_missedupdates, 
+		       pvt->cntr_nearend_speech_frames,
+		       pvt->cntr_residualcorrected_frames, pvt->cntr_residualcorrected_framesskipped,
+		       pvt->cntr_coeff_updates, pvt->cntr_coeff_missedupdates,
 		       pvt->avg_Lu_i_ok, pvt->avg_Lu_i_toolow);
 
 		pvt->cntr_nearend_speech_frames = 0;
@@ -787,9 +787,9 @@
 		2 * sizeof(short) * (maxu) +			/* u_s */
 		2 * sizeof(short) * ecp->tap_length;		/* y_tilde_s */
 
-	if (!(pvt = kzalloc(size, GFP_KERNEL))) {
+	pvt = kzalloc(size, GFP_KERNEL);
+	if (!pvt)
 		return -ENOMEM;
-	}
 
 	pvt->dahdi.ops = &my_ops;
 
@@ -823,8 +823,8 @@
 	pvt->HCNTR_d = pvt->N_d << 1;
 
 	if (pos >= pvt->N_d) {
-		memcpy(pvt->b_i,pvt->a_i,pvt->N_d*sizeof(int));
-		memcpy(pvt->c_i,pvt->a_i,pvt->N_d*sizeof(int));
+		memcpy(pvt->b_i, pvt->a_i, pvt->N_d*sizeof(int));
+		memcpy(pvt->c_i, pvt->a_i, pvt->N_d*sizeof(int));
 		return 1;
 	}
 
@@ -832,8 +832,8 @@
 	pvt->a_s[pos] = val << 1;
 
 	if (++pos >= pvt->N_d) {
-		memcpy(pvt->b_i,pvt->a_i,pvt->N_d*sizeof(int));
-		memcpy(pvt->c_i,pvt->a_i,pvt->N_d*sizeof(int));
+		memcpy(pvt->b_i, pvt->a_i, pvt->N_d*sizeof(int));
+		memcpy(pvt->c_i, pvt->a_i, pvt->N_d*sizeof(int));
 		return 1;
 	}
 

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_oslec.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_oslec.c?view=diff&rev=6370&r1=6369&r2=6370
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_oslec.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_oslec.c Wed Apr 15 15:12:50 2009
@@ -93,9 +93,9 @@
 		return -EINVAL;
 	}
 
-	if (!(pvt = kzalloc(sizeof(*pvt), GFP_KERNEL))) {
+	pvt = kzalloc(sizeof(*pvt), GFP_KERNEL);
+	if (!pvt)
 		return -ENOMEM;
-	}
 
 	pvt->dahdi.ops = &my_ops;
 

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec.c?view=diff&rev=6370&r1=6369&r2=6370
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec.c Wed Apr 15 15:12:50 2009
@@ -123,7 +123,7 @@
 	int tap_mask;
 	int use_nlp;
 	int use_suppressor;
-	
+
 	int32_t supp_test1;
 	int32_t supp_test2;
 	int32_t supp1;
@@ -149,9 +149,9 @@
 
 	size = sizeof(*pvt) + ecp->tap_length * sizeof(int32_t) + ecp->tap_length * 3 * sizeof(int16_t);
 	
-	if (!(pvt = kzalloc(size, GFP_KERNEL))) {
+	pvt = kzalloc(size, GFP_KERNEL);
+	if (!pvt)
 		return -ENOMEM;
-	}
 
 	pvt->dahdi.ops = &my_ops;
 	pvt->dahdi.features = my_features;
@@ -234,7 +234,7 @@
 			/* There is no far-end speech detected */
 			if (pvt->nonupdate_dwell == 0) {
 				/* ... and we are not in the dwell time from previous speech. */
-				//nsuppr = saturate((clean_rx << 16)/pvt->tx_power);
+				/* nsuppr = saturate((clean_rx << 16)/pvt->tx_power); */
 				nsuppr = (clean_rx << 16) / pvt->tx_power;
 				nsuppr >>= 4;
 				if (nsuppr > 512)

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec2.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec2.c?view=diff&rev=6370&r1=6369&r2=6370
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec2.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec2.c Wed Apr 15 15:12:50 2009
@@ -139,9 +139,9 @@
 
 	size = sizeof(*pvt) + ecp->tap_length * sizeof(int32_t) + ecp->tap_length * 3 * sizeof(int16_t);
 	
-	if (!(pvt = kzalloc(size, GFP_KERNEL))) {
+	pvt = kzalloc(size, GFP_KERNEL);
+	if (!pvt)
 		return -ENOMEM;
-	}
 
 	pvt->dahdi.ops = &my_ops;
 
@@ -200,14 +200,14 @@
 	   bad!), but 32 bit coeffs require some shifting. On balance 32 bit seems
 	   best */
 	echo_value = fir16 (&pvt->fir_state, tx);
-	
+
 	/* And the answer is..... */
 	clean_rx = rx - echo_value;
-	
+
 	/* That was the easy part. Now we need to adapt! */
 	if (pvt->nonupdate_dwell > 0)
 		pvt->nonupdate_dwell--;
-	
+
 	/* If there is very little being transmitted, any attempt to train is
 	   futile. We would either be training on the far end's noise or signal,
 	   the channel's own noise, or our noise. Either way, this is hardly good
@@ -223,9 +223,9 @@
 			/* There is no far-end speech detected */
 			if (pvt->nonupdate_dwell == 0) {
 				/* ... and we are not in the dwell time from previous speech. */
-				//nsuppr = saturate((clean_rx << 16)/pvt->tx_power);
+				/* nsuppr = saturate((clean_rx << 16)/pvt->tx_power); */
 				nsuppr = clean_rx >> 3;
-				
+
 				/* Update the FIR taps */
 				offset2 = pvt->curr_pos + 1;
 				offset1 = pvt->taps - offset2;

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/dahdi_echocan_hpec.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/dahdi_echocan_hpec.c?view=diff&rev=6370&r1=6369&r2=6370
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/dahdi_echocan_hpec.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/dahdi_echocan_hpec.c Wed Apr 15 15:12:50 2009
@@ -125,9 +125,9 @@
 		return -EINVAL;
 	}
 
-	if (!(pvt = kzalloc(sizeof(*pvt), GFP_KERNEL))) {
+	pvt = kzalloc(sizeof(*pvt), GFP_KERNEL);
+	if (!pvt)
 		return -ENOMEM;
-	}
 
 	pvt->dahdi.ops = &my_ops;
 	pvt->dahdi.features = my_features;




More information about the svn-commits mailing list