From d10c65169c03364ad28fe3a1f018333061972696 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Sat, 30 May 2009 21:45:46 -0300 Subject: [PATCH] --- yaml --- r: 153957 b: refs/heads/master c: 9bd0e8d7d1bf0dc586bad905c7878b611da3acdc h: refs/heads/master i: 153955: 4357ab901cef1987a2ab43e0e21047a7c128318e v: v3 --- [refs] | 2 +- .../drivers/media/video/cx231xx/cx231xx-video.c | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index 0dba9b29a088..3dca5abee6ca 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 653dc59b6468c2ba51f3b4aee609daa8f67d3e3a +refs/heads/master: 9bd0e8d7d1bf0dc586bad905c7878b611da3acdc diff --git a/trunk/drivers/media/video/cx231xx/cx231xx-video.c b/trunk/drivers/media/video/cx231xx/cx231xx-video.c index a23ae73fe634..6a524d847110 100644 --- a/trunk/drivers/media/video/cx231xx/cx231xx-video.c +++ b/trunk/drivers/media/video/cx231xx/cx231xx-video.c @@ -955,8 +955,8 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, { struct cx231xx_fh *fh = priv; struct cx231xx *dev = fh->dev; - int width = f->fmt.pix.width; - int height = f->fmt.pix.height; + unsigned int width = f->fmt.pix.width; + unsigned int height = f->fmt.pix.height; unsigned int maxw = norm_maxw(dev); unsigned int maxh = norm_maxh(dev); unsigned int hscale, vscale; @@ -971,17 +971,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, /* width must even because of the YUYV format height must be even because of interlacing */ - height &= 0xfffe; - width &= 0xfffe; - - if (unlikely(height < 32)) - height = 32; - if (unlikely(height > maxh)) - height = maxh; - if (unlikely(width < 48)) - width = 48; - if (unlikely(width > maxw)) - width = maxw; + v4l_bound_align_image(&width, 48, maxw, 1, &height, 32, maxh, 1, 0); get_scale(dev, width, height, &hscale, &vscale);