calibrate: use div_u64_rem for old compiler compat

Under CERN CO current standard compiler
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)
a long, 64 bit division is generated even if the divisor is
a power of 2 (sigh). So we need yet another div_u64_rem.
parent 24d7d843
......@@ -64,6 +64,7 @@ static uint64_t output_delay_ps(struct spec_fd *fd, int ch, int fine, int n,
int i;
uint64_t *results;
uint64_t res, acc = 0;
int rem;
results = kmalloc(n * sizeof(*results), GFP_KERNEL);
if (!results)
......@@ -119,7 +120,7 @@ static uint64_t output_delay_ps(struct spec_fd *fd, int ch, int fine, int n,
fd_ch_writel(fd, ch, 0, FD_REG_DCR);
/* Calculate avg, min max */
acc = (acc + n / 2) / n;
acc = div_u64_rem((acc + n / 2), n, &rem);
if (stats) {
stats->avg = acc;
stats->min = ~0LL;
......
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