From: Andy Walls Date: Fri, 29 May 2009 23:54:02 +0000 (-0300) Subject: V4L/DVB (11898): cx18: Perform 64 bit divide so it works for 32 bit systems X-Git-Tag: v2.6.31-rc1~297^2~122 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ad4c6551b8540054f51b483ce513ccb87f8181b;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git V4L/DVB (11898): cx18: Perform 64 bit divide so it works for 32 bit systems Thanks to David Ward and Mike Krufky for reporting the problem and debugging this as an unresolved symbol due to a 64 bit divide on a 32 bit system. David Ward provided the content of this patch; Andy Walls only performed some cosmetic edits. Reported-by: David Ward Signed-off-by: David Ward Signed-off-by: Andy Walls Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/cx18/cx18-av-core.c b/drivers/media/video/cx18/cx18-av-core.c index 0b3d840..536dedb 100644 --- a/drivers/media/video/cx18/cx18-av-core.c +++ b/drivers/media/video/cx18/cx18-av-core.c @@ -447,6 +447,7 @@ void cx18_av_std_setup(struct cx18 *cx) if (pll_post) { int fsc, pll; + u64 tmp; pll = (28636360L * ((((u64)pll_int) << 25) + pll_frac)) >> 25; pll /= pll_post; @@ -459,7 +460,9 @@ void cx18_av_std_setup(struct cx18 *cx) "= %d.%03d\n", src_decimation / 256, ((src_decimation % 256) * 1000) / 256); - fsc = ((((u64)sc) * 28636360)/src_decimation) >> 13L; + tmp = 28636360 * (u64) sc; + do_div(tmp, src_decimation); + fsc = tmp >> 13; CX18_DEBUG_INFO_DEV(sd, "Chroma sub-carrier initial freq = %d.%06d " "MHz\n", fsc / 1000000, fsc % 1000000);