diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-16 21:36:13 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-16 21:36:13 -0200 |
commit | e19130557b656d2b6aeaf8da6a9a58e428ef1b00 (patch) | |
tree | 792e387102318afb1b54ee433e4549b4214bca80 /linux | |
parent | a382f22c815364a55ab62b31eb5f3b6157dc250c (diff) | |
download | mediapointer-dvb-s2-e19130557b656d2b6aeaf8da6a9a58e428ef1b00.tar.gz mediapointer-dvb-s2-e19130557b656d2b6aeaf8da6a9a58e428ef1b00.tar.bz2 |
em28xx: vidioc_try_fmt_vid_cap() doesn't need any lock
From: Mauro Carvalho Chehab <mchehab@redhat.com>
vidioc_try_fmt_vid_cap() just checks if a given resolution is supported.
It doesn't touch on struct em28xx device descriptor. so, there's no need
to lock.
While there, use unlikely() for those values that aren't likely to
occur.
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-video.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c index d486bc204..415ac9861 100644 --- a/linux/drivers/media/video/em28xx/em28xx-video.c +++ b/linux/drivers/media/video/em28xx/em28xx-video.c @@ -735,19 +735,17 @@ 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; + width &= 0xfffe; - if (height < 32) + if (unlikely(height < 32)) height = 32; - if (height > maxh) + if (unlikely(height > maxh)) height = maxh; - if (width < 48) + if (unlikely(width < 48)) width = 48; - if (width > maxw) + if (unlikely(width > maxw)) width = maxw; - mutex_lock(&dev->lock); - if (dev->board.is_em2800) { /* the em2800 can only scale down to 50% */ if (height % (maxh / 2)) @@ -777,7 +775,6 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; f->fmt.pix.field = V4L2_FIELD_INTERLACED; - mutex_unlock(&dev->lock); return 0; } |