diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-08 23:18:24 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-08 23:18:24 +0000 |
commit | d933db51bba0b9f9419ac7046cbd6df20c10b960 (patch) | |
tree | bd16177e1b04193cce58b29faf6cc06cc8d82fa2 /linux/drivers/media/video/cx88 | |
parent | e8f43bdccb27fa9f829fc5c0123514b0fda2c841 (diff) | |
download | mediapointer-dvb-s2-d933db51bba0b9f9419ac7046cbd6df20c10b960.tar.gz mediapointer-dvb-s2-d933db51bba0b9f9419ac7046cbd6df20c10b960.tar.bz2 |
cx88-dsp: fixing 64bit math on 32bit kernels
From: Miroslav Sustek <sustmidown@centrum.cz>
Signed-off-by: Miroslav Sustek <sustmidown@centrum.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/cx88')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-dsp.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-dsp.c b/linux/drivers/media/video/cx88/cx88-dsp.c index 262bda9ec..4699055f2 100644 --- a/linux/drivers/media/video/cx88/cx88-dsp.c +++ b/linux/drivers/media/video/cx88/cx88-dsp.c @@ -22,6 +22,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/jiffies.h> +#include <asm/div64.h> #include "cx88.h" #include "cx88-reg.h" @@ -101,8 +102,8 @@ static u32 int_goertzel(s16 x[], u32 N, u32 freq) s32 coeff = 2*int_cos(freq); u32 i; - s64 tmp; - u32 remainder; + u64 tmp; + u32 divisor; for (i = 0; i < N; i++) { s32 s = x[i] + ((s64)coeff*s_prev/32768) - s_prev2; @@ -115,7 +116,10 @@ static u32 int_goertzel(s16 x[], u32 N, u32 freq) /* XXX: N must be low enough so that N*N fits in s32. * Else we need two divisions. */ - return (u32) div_s64_rem(tmp, N*N, &remainder); + divisor = N * N; + do_div(tmp, divisor); + + return (u32) tmp; } static u32 freq_magnitude(s16 x[], u32 N, u32 freq) |