From: dean anderson <linux-dev@sensoray.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
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: Re: [patch 1/2] [media] s2255drv: cleanup vidioc_enum_fmt_cap()
Date: Fri, 17 Feb 2012 23:14:42 +0000 [thread overview]
Message-ID: <4F3EDF62.9090005@sensoray.com> (raw)
In-Reply-To: <20120217064327.GA3666@elgon.mountain>
Thanks Dan,
I can sign off on this. The check isn't required.
Signed-off-by: Dean Anderson <linux-dev@sensoray.com>
On 2/16/2012 10:43 PM, Dan Carpenter wrote:
> "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;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
WARNING: multiple messages have this Message-ID (diff)
From: dean anderson <linux-dev@sensoray.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
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: Re: [patch 1/2] [media] s2255drv: cleanup vidioc_enum_fmt_cap()
Date: Fri, 17 Feb 2012 15:14:42 -0800 [thread overview]
Message-ID: <4F3EDF62.9090005@sensoray.com> (raw)
In-Reply-To: <20120217064327.GA3666@elgon.mountain>
Thanks Dan,
I can sign off on this. The check isn't required.
Signed-off-by: Dean Anderson <linux-dev@sensoray.com>
On 2/16/2012 10:43 PM, Dan Carpenter wrote:
> "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;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2012-02-17 23:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-17 6:43 [patch 1/2] [media] s2255drv: cleanup vidioc_enum_fmt_cap() Dan Carpenter
2012-02-17 6:43 ` Dan Carpenter
2012-02-17 23:14 ` dean anderson [this message]
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=4F3EDF62.9090005@sensoray.com \
--to=linux-dev@sensoray.com \
--cc=dan.carpenter@oracle.com \
--cc=hans.verkuil@cisco.com \
--cc=kernel-janitors@vger.kernel.org \
--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.