staging: rtl8188eu: abs kernel macro used in simularity_compare function
authorIvan Safonov <insafonov@gmail.com>
Tue, 27 Oct 2015 15:20:28 +0000 (22:20 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2015 00:09:08 +0000 (09:09 +0900)
abs macro is useful for determining the difference between the two integers.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/phy.c

index bb3c7773d74fff9d20b7d942516624e903b06f1e..d3e8a8ea18295b2820b8f8a7b2041e66331c4190 100644 (file)
@@ -1013,7 +1013,7 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8],
                        tmp2 = resulta[c2][i];
                }
 
-               diff = (tmp1 > tmp2) ? (tmp1 - tmp2) : (tmp2 - tmp1);
+               diff = abs(tmp1 - tmp2);
 
                if (diff > MAX_TOLERANCE) {
                        if ((i == 2 || i == 6) && !sim_bitmap) {