From: Dan Carpenter <dan.carpenter@oracle.com>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Dean Anderson <linux-dev@sensoray.com>,
Hans Verkuil <hans.verkuil@cisco.com>,
Pete Eberlein <pete@sensoray.com>,
linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch 1/2] [media] s2255drv: cleanup vidioc_enum_fmt_cap()
Date: Fri, 17 Feb 2012 06:43:27 +0000 [thread overview]
Message-ID: <20120217064327.GA3666@elgon.mountain> (raw)
"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>
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index c1bef61..3505242 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;
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Dean Anderson <linux-dev@sensoray.com>,
Hans Verkuil <hans.verkuil@cisco.com>,
Pete Eberlein <pete@sensoray.com>,
linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch 1/2] [media] s2255drv: cleanup vidioc_enum_fmt_cap()
Date: Fri, 17 Feb 2012 09:43:27 +0300 [thread overview]
Message-ID: <20120217064327.GA3666@elgon.mountain> (raw)
"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>
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index c1bef61..3505242 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;
next reply other threads:[~2012-02-17 6:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-17 6:43 Dan Carpenter [this message]
2012-02-17 6:43 ` [patch 1/2] [media] s2255drv: cleanup vidioc_enum_fmt_cap() Dan Carpenter
2012-02-17 23:14 ` dean anderson
2012-02-17 23:14 ` dean anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120217064327.GA3666@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=hans.verkuil@cisco.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-dev@sensoray.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=pete@sensoray.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.