Merge pull request #866 from neheb/2
[feed/telephony.git] / libs / dahdi-linux / patches / 206-dahdi_echocan_mg2-rename-ABS-define-to-PARA_ABS.patch
1 From d2563faf053da31e1329e7313339669f31c989da Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Wed, 20 Mar 2024 19:48:33 +0100
4 Subject: [PATCH] dahdi_echocan_mg2: rename ABS define to PARA_ABS
5
6 Rename ABS define to PARA_ABS to fix compilation error with mips 24kc
7 arch.
8
9 This target define in his ASM header a similar define ABS that cause
10 conflicts and redefinition error for this driver.
11
12 Rename ABS to PARA_ABS to better suite the usage as it's abs usage with
13 value decremented by one if it's the max negative int.
14
15 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
16 ---
17 drivers/dahdi/dahdi_echocan_mg2.c | 6 +++---
18 1 file changed, 3 insertions(+), 3 deletions(-)
19
20 --- a/drivers/dahdi/dahdi_echocan_mg2.c
21 +++ b/drivers/dahdi/dahdi_echocan_mg2.c
22 @@ -44,7 +44,7 @@
23 static int debug;
24 static int aggressive;
25
26 -#define ABS(a) abs(a!=-32768?a:-32767)
27 +#define PARA_ABS(a) abs(a!=-32768?a:-32767)
28
29 #define RESTORE_COEFFS {\
30 int x;\
31 @@ -464,9 +464,9 @@ static inline short sample_update(struct
32 RESTORE_COEFFS;
33 }
34
35 - sign_error = ABS(rs) - ABS(isig);
36 + sign_error = PARA_ABS(rs) - PARA_ABS(isig);
37
38 - if (ABS(sign_error) > MAX_SIGN_ERROR)
39 + if (PARA_ABS(sign_error) > MAX_SIGN_ERROR)
40 {
41 rs = 0;
42 RESTORE_COEFFS;