diff mbox

[-next,media] media: davinci: vpbe: return error code on error in vpbe_display_g_crop()

Message ID CAPgLHd-9LAbh_VvKsGZOy5tTtoHd1--TREKV=E9KUnc=DLkxng@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Dec. 3, 2012, 2:50 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

We have assigned error code to 'ret' if crop->type is not
V4L2_BUF_TYPE_VIDEO_OUTPUT, but never use it. 
We'd better return the error code on this error.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/media/platform/davinci/vpbe_display.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)



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

Prabhakar Dec. 3, 2012, 6:01 a.m. UTC | #1
Wei,

On Mon, Dec 3, 2012 at 8:20 AM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> We have assigned error code to 'ret' if crop->type is not
> V4L2_BUF_TYPE_VIDEO_OUTPUT, but never use it.
> We'd better return the error code on this error.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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

Regards,
--Prabhakar

> ---
>  drivers/media/platform/davinci/vpbe_display.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
> index 2bfde79..119a100 100644
> --- a/drivers/media/platform/davinci/vpbe_display.c
> +++ b/drivers/media/platform/davinci/vpbe_display.c
> @@ -791,7 +791,6 @@ static int vpbe_display_g_crop(struct file *file, void *priv,
>         struct vpbe_device *vpbe_dev = fh->disp_dev->vpbe_dev;
>         struct osd_state *osd_device = fh->disp_dev->osd_device;
>         struct v4l2_rect *rect = &crop->c;
> -       int ret;
>
>         v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev,
>                         "VIDIOC_G_CROP, layer id = %d\n",
> @@ -799,7 +798,7 @@ static int vpbe_display_g_crop(struct file *file, void *priv,
>
>         if (crop->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) {
>                 v4l2_err(&vpbe_dev->v4l2_dev, "Invalid buf type\n");
> -               ret = -EINVAL;
> +               return -EINVAL;
>         }
>         osd_device->ops.get_layer_config(osd_device,
>                                 layer->layer_info.id, cfg);
>
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> Davinci-linux-open-source@linux.davincidsp.com
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
--
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/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
index 2bfde79..119a100 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -791,7 +791,6 @@  static int vpbe_display_g_crop(struct file *file, void *priv,
 	struct vpbe_device *vpbe_dev = fh->disp_dev->vpbe_dev;
 	struct osd_state *osd_device = fh->disp_dev->osd_device;
 	struct v4l2_rect *rect = &crop->c;
-	int ret;
 
 	v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev,
 			"VIDIOC_G_CROP, layer id = %d\n",
@@ -799,7 +798,7 @@  static int vpbe_display_g_crop(struct file *file, void *priv,
 
 	if (crop->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) {
 		v4l2_err(&vpbe_dev->v4l2_dev, "Invalid buf type\n");
-		ret = -EINVAL;
+		return -EINVAL;
 	}
 	osd_device->ops.get_layer_config(osd_device,
 				layer->layer_info.id, cfg);