aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media/dvb-frontends/stv0367_priv.h
diff options
context:
space:
mode:
authorDan Gopstein <dgopstein@nyu.edu>2017-12-25 16:16:14 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-03-06 04:08:17 -0500
commit7aa92c4229fefff0cab6930cf977f4a0e3e606d8 (patch)
tree31f5e43b03e4837db5eff1dc04ed477d2bfdaf43 /drivers/media/dvb-frontends/stv0367_priv.h
parentmedia: dvb-frontend/mxl5xx: add support for physical layer scrambling (diff)
downloadwireguard-linux-7aa92c4229fefff0cab6930cf977f4a0e3e606d8.tar.xz
wireguard-linux-7aa92c4229fefff0cab6930cf977f4a0e3e606d8.zip
media: ABS macro parameter parenthesization
Replace usages of the locally defined ABS() macro with calls to the canonical abs() from kernel.h and remove the old definitions of ABS() This change was originally motivated by two local definitions of the ABS (absolute value) macro that fail to parenthesize their parameter properly. This can lead to a bad expansion for low-precedence expression arguments. For example: ABS(1-2) currently expands to ((1-2) < 0 ? (-1-2) : (1-2)) which evaluates to -3. But the correct expansion would be ((1-2) < 0 ? -(1-2) : (1-2)) which evaluates to 1. Signed-off-by: Dan Gopstein <dgopstein@nyu.edu> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/dvb-frontends/stv0367_priv.h')
-rw-r--r--drivers/media/dvb-frontends/stv0367_priv.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/stv0367_priv.h b/drivers/media/dvb-frontends/stv0367_priv.h
index 8abc451dd524..460066a391b7 100644
--- a/drivers/media/dvb-frontends/stv0367_priv.h
+++ b/drivers/media/dvb-frontends/stv0367_priv.h
@@ -35,7 +35,6 @@
#endif
/* MACRO definitions */
-#define ABS(X) ((X) < 0 ? (-1 * (X)) : (X))
#define MAX(X, Y) ((X) >= (Y) ? (X) : (Y))
#define MIN(X, Y) ((X) <= (Y) ? (X) : (Y))
#define INRANGE(X, Y, Z) \