* [PATCH] cobalt: fix 64-bit division
@ 2015-06-10 5:45 Hans Verkuil
0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2015-06-10 5:45 UTC (permalink / raw)
To: Linux Media Mailing List
There was still one more remaining 64-bit division in the cobalt code.
Replace it by div_u64.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c
index 6fb8812..b40c2d1 100644
--- a/drivers/media/pci/cobalt/cobalt-v4l2.c
+++ b/drivers/media/pci/cobalt/cobalt-v4l2.c
@@ -327,7 +327,7 @@ static int cobalt_start_streaming(struct vb2_queue *q, unsigned int count)
iowrite32(clk_freq / 1000000, &clkloss->ref_clk_cnt_val);
/* The lower bound for the clock frequency is 0.5% lower as is
* allowed by the spec */
- iowrite32((((u64)bt->pixelclock * 995) / 1000) / 1000000,
+ iowrite32(div_u64(bt->pixelclock * 995, 1000000000),
&clkloss->test_clk_cnt_val);
/* will be enabled after the first frame has been received */
iowrite32(bt->width * bt->height, &fw->active_length);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-06-10 5:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 5:45 [PATCH] cobalt: fix 64-bit division Hans Verkuil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).