linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/2] [media] s2255drv: cleanup vidioc_enum_fmt_cap()
@ 2012-02-17  6:43 Dan Carpenter
  2012-02-17 23:14 ` dean anderson
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-02-17  6:43 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Dean Anderson, Hans Verkuil, Pete Eberlein, linux-media,
	kernel-janitors

"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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch 1/2] [media] s2255drv: cleanup vidioc_enum_fmt_cap()
  2012-02-17  6:43 [patch 1/2] [media] s2255drv: cleanup vidioc_enum_fmt_cap() Dan Carpenter
@ 2012-02-17 23:14 ` dean anderson
  0 siblings, 0 replies; 2+ messages in thread
From: dean anderson @ 2012-02-17 23:14 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Mauro Carvalho Chehab, Dean Anderson, Hans Verkuil, Pete Eberlein,
	linux-media, kernel-janitors

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
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-17 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-17  6:43 [patch 1/2] [media] s2255drv: cleanup vidioc_enum_fmt_cap() Dan Carpenter
2012-02-17 23:14 ` dean anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).