[media] media: sh_vou: fix const cropping related warnings
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Fri, 28 Sep 2012 10:28:58 +0000 (07:28 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 22 Nov 2012 12:37:40 +0000 (10:37 -0200)
A recent commit "[media] v4l2: make vidioc_s_crop const" introduced
warnings in sh_vou. Fix them by cleanly separating writable and
read-only variables in cropping operations.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/sh_vou.c

index 85fd312f0a829fee9f45b1e682694cc3fc475cf3..a1c87f0ceaabe0285ddd2d6b03dd3ead5303d22d 100644 (file)
@@ -935,9 +935,10 @@ static int sh_vou_g_crop(struct file *file, void *fh, struct v4l2_crop *a)
 /* Assume a dull encoder, do all the work ourselves. */
 static int sh_vou_s_crop(struct file *file, void *fh, const struct v4l2_crop *a)
 {
+       struct v4l2_crop a_writable = *a;
        struct video_device *vdev = video_devdata(file);
        struct sh_vou_device *vou_dev = video_get_drvdata(vdev);
-       struct v4l2_rect *rect = &a->c;
+       struct v4l2_rect *rect = &a_writable.c;
        struct v4l2_crop sd_crop = {.type = V4L2_BUF_TYPE_VIDEO_OUTPUT};
        struct v4l2_pix_format *pix = &vou_dev->pix;
        struct sh_vou_geometry geo;