aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-02-17 00:43:27 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-03-08 08:39:56 -0500
commit6c61ac635535bbabf4f374df171372d012b0e822 (patch)
tree00a24e27c09c871c9bcf93c8abdbbf5120067bc3 /drivers/media/video
parentda0af4788c4e992bf8085b8f585b0fa9c69970fa (diff)
[media] s2255drv: cleanup vidioc_enum_fmt_cap()
"f" wasn't checked consistently, so static checkers complain. This function is always called with a valid "f" pointer, so I have removed the check. Also the indenting was messed up. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Dean Anderson <linux-dev@sensoray.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/s2255drv.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index c1bef6187661..350524246ce0 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -852,15 +852,13 @@ static int vidioc_querycap(struct file *file, void *priv,
852static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, 852static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
853 struct v4l2_fmtdesc *f) 853 struct v4l2_fmtdesc *f)
854{ 854{
855 int index = 0; 855 int index = f->index;
856 if (f)
857 index = f->index;
858 856
859 if (index >= ARRAY_SIZE(formats)) 857 if (index >= ARRAY_SIZE(formats))
860 return -EINVAL; 858 return -EINVAL;
861 if (!jpeg_enable && ((formats[index].fourcc == V4L2_PIX_FMT_JPEG) || 859 if (!jpeg_enable && ((formats[index].fourcc == V4L2_PIX_FMT_JPEG) ||
862 (formats[index].fourcc == V4L2_PIX_FMT_MJPEG))) 860 (formats[index].fourcc == V4L2_PIX_FMT_MJPEG)))
863 return -EINVAL; 861 return -EINVAL;
864 dprintk(4, "name %s\n", formats[index].name); 862 dprintk(4, "name %s\n", formats[index].name);
865 strlcpy(f->description, formats[index].name, sizeof(f->description)); 863 strlcpy(f->description, formats[index].name, sizeof(f->description));
866 f->pixelformat = formats[index].fourcc; 864 f->pixelformat = formats[index].fourcc;