Commit 6c61ac63 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab

[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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDean Anderson <linux-dev@sensoray.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent da0af478
...@@ -852,15 +852,13 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -852,15 +852,13 @@ static int vidioc_querycap(struct file *file, void *priv,
static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f) struct v4l2_fmtdesc *f)
{ {
int index = 0; int index = f->index;
if (f)
index = f->index;
if (index >= ARRAY_SIZE(formats)) if (index >= ARRAY_SIZE(formats))
return -EINVAL; return -EINVAL;
if (!jpeg_enable && ((formats[index].fourcc == V4L2_PIX_FMT_JPEG) || if (!jpeg_enable && ((formats[index].fourcc == V4L2_PIX_FMT_JPEG) ||
(formats[index].fourcc == V4L2_PIX_FMT_MJPEG))) (formats[index].fourcc == V4L2_PIX_FMT_MJPEG)))
return -EINVAL; return -EINVAL;
dprintk(4, "name %s\n", formats[index].name); dprintk(4, "name %s\n", formats[index].name);
strlcpy(f->description, formats[index].name, sizeof(f->description)); strlcpy(f->description, formats[index].name, sizeof(f->description));
f->pixelformat = formats[index].fourcc; f->pixelformat = formats[index].fourcc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment