diff mbox

[media] sh_vou: almost forever loop in sh_vou_try_fmt_vid_out()

Message ID 20130823095444.GR31293@elgon.mountain (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Aug. 23, 2013, 9:54 a.m. UTC
The "i < " part of the "i < ARRAY_SIZE()" condition was missing.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

Comments

Lad, Prabhakar Aug. 26, 2013, 2:47 a.m. UTC | #1
On Fri, Aug 23, 2013 at 3:24 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The "i < " part of the "i < ARRAY_SIZE()" condition was missing.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by:  Lad, Prabhakar <prabhakar.lad@ti.com>

Regards,
--Prabhakar Lad

>
> diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
> index 7a9c5e9..41f612c 100644
> --- a/drivers/media/platform/sh_vou.c
> +++ b/drivers/media/platform/sh_vou.c
> @@ -776,9 +776,10 @@ static int sh_vou_try_fmt_vid_out(struct file *file, void *priv,
>         v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 1,
>                               &pix->height, 0, VOU_MAX_IMAGE_HEIGHT, 1, 0);
>
> -       for (i = 0; ARRAY_SIZE(vou_fmt); i++)
> +       for (i = 0; i < ARRAY_SIZE(vou_fmt); i++) {
>                 if (vou_fmt[i].pfmt == pix->pixelformat)
>                         return 0;
> +       }
>
>         pix->pixelformat = vou_fmt[0].pfmt;
>
--
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
diff mbox

Patch

diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c
index 7a9c5e9..41f612c 100644
--- a/drivers/media/platform/sh_vou.c
+++ b/drivers/media/platform/sh_vou.c
@@ -776,9 +776,10 @@  static int sh_vou_try_fmt_vid_out(struct file *file, void *priv,
 	v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 1,
 			      &pix->height, 0, VOU_MAX_IMAGE_HEIGHT, 1, 0);
 
-	for (i = 0; ARRAY_SIZE(vou_fmt); i++)
+	for (i = 0; i < ARRAY_SIZE(vou_fmt); i++) {
 		if (vou_fmt[i].pfmt == pix->pixelformat)
 			return 0;
+	}
 
 	pix->pixelformat = vou_fmt[0].pfmt;