summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi_echocan_mg2.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-10-28 21:49:02 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-10-28 21:49:02 +0000
commit1b3b35987cc3e8c555f148306234e5f732761bd5 (patch)
tree8acd0b016433ced01fd64876a031381c822c30aa /drivers/dahdi/dahdi_echocan_mg2.c
parent45a52ab6fce416fe92a80108e815556b0a2335ea (diff)
fix a large number of warnings found by sparse, the kernel code sanity checking tool. some of these fixes are non-optimal (casting 'unsigned long' to '__user void *'), but are unavoidable in many cases. started from tzafrir's patch, did most of the work myself.
(closes issue #13763) Reported by: tzafrir Patches: sparse_fixes_1.diff uploaded by tzafrir (license 46) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5162 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi_echocan_mg2.c')
-rw-r--r--drivers/dahdi/dahdi_echocan_mg2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/dahdi/dahdi_echocan_mg2.c b/drivers/dahdi/dahdi_echocan_mg2.c
index b365f78..6ca0860 100644
--- a/drivers/dahdi/dahdi_echocan_mg2.c
+++ b/drivers/dahdi/dahdi_echocan_mg2.c
@@ -425,6 +425,8 @@ static inline short sample_update(struct echo_can_state *ec, short iref, short i
* we should pass it through uncancelled, as we are likely on hold */
u = isig;
} else {
+ int sign_error;
+
if (rs < -32768) {
rs = -32768;
ec->HCNTR_d = DEFAULT_HANGT;
@@ -435,7 +437,9 @@ static inline short sample_update(struct echo_can_state *ec, short iref, short i
RESTORE_COEFFS;
}
- if (ABS(ABS(rs)-ABS(isig)) > MAX_SIGN_ERROR)
+ sign_error = ABS(rs) - ABS(isig);
+
+ if (ABS(sign_error) > MAX_SIGN_ERROR)
{
rs = 0;
RESTORE_COEFFS;