Commit e074da3f authored by Mike Rapoport's avatar Mike Rapoport Committed by Greg Kroah-Hartman

staging: sm750fb: replace absDiff with kernel standard abs macro

<linux/kernel.h> already has 'abs', use it instead of custom absDiff
Signed-off-by: default avatarMike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0d5d733b
#include <linux/kernel.h>
#include <linux/sizes.h>
#include "ddk750_help.h"
......@@ -335,7 +336,7 @@ unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll)
unsigned int diff;
tmpClock = pll->inputFreq * M / N / X;
diff = absDiff(tmpClock, request_orig);
diff = abs(tmpClock - request_orig);
if (diff < mini_diff) {
pll->M = M;
pll->N = N;
......
......@@ -38,14 +38,6 @@
#define FIELD_SIZE(field) (1 + FIELD_END(field) - FIELD_START(field))
#define FIELD_MASK(field) (((1 << (FIELD_SIZE(field)-1)) | ((1 << (FIELD_SIZE(field)-1)) - 1)) << FIELD_START(field))
static inline unsigned int absDiff(unsigned int a, unsigned int b)
{
if (a < b)
return b-a;
else
return a-b;
}
/* n / d + 1 / 2 = (2n + d) / 2d */
#define roundedDiv(num, denom) ((2 * (num) + (denom)) / (2 * (denom)))
#define MHz(x) ((x) * 1000000)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment