diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-02-17 02:43:27 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-08 10:39:56 -0300 |
commit | 6c61ac635535bbabf4f374df171372d012b0e822 (patch) | |
tree | 00a24e27c09c871c9bcf93c8abdbbf5120067bc3 | |
parent | da0af4788c4e992bf8085b8f585b0fa9c69970fa (diff) | |
download | linux-6c61ac635535bbabf4f374df171372d012b0e822.tar.gz linux-6c61ac635535bbabf4f374df171372d012b0e822.tar.bz2 linux-6c61ac635535bbabf4f374df171372d012b0e822.zip |
[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>
-rw-r--r-- | drivers/media/video/s2255drv.c | 10 |
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, static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *f) { - int index = 0; - if (f) - index = f->index; + int index = f->index; if (index >= ARRAY_SIZE(formats)) return -EINVAL; - if (!jpeg_enable && ((formats[index].fourcc == V4L2_PIX_FMT_JPEG) || - (formats[index].fourcc == V4L2_PIX_FMT_MJPEG))) - return -EINVAL; + if (!jpeg_enable && ((formats[index].fourcc == V4L2_PIX_FMT_JPEG) || + (formats[index].fourcc == V4L2_PIX_FMT_MJPEG))) + return -EINVAL; dprintk(4, "name %s\n", formats[index].name); strlcpy(f->description, formats[index].name, sizeof(f->description)); f->pixelformat = formats[index].fourcc; |