2012-10-03 06:27:59

by Lad, Prabhakar

[permalink] [raw]
Subject: [PATCH] media: davinci: vpbe: fix build warning

From: Lad, Prabhakar <[email protected]>

recent patch with commit id 4f996594ceaf6c3f9bc42b40c40b0f7f87b79c86
which makes vidioc_s_crop const, was causing a following build warning,

vpbe_display.c: In function 'vpbe_display_s_crop':
vpbe_display.c:640: warning: initialization discards qualifiers from pointer target type

This patch fixes the above build warning.

Signed-off-by: Lad, Prabhakar <[email protected]>
Signed-off-by: Manjunath Hadli <[email protected]>
Cc: Hans Verkuil <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
---
drivers/media/platform/davinci/vpbe_display.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
index 1b238fe..161c776 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -637,7 +637,7 @@ static int vpbe_display_s_crop(struct file *file, void *priv,
struct vpbe_device *vpbe_dev = disp_dev->vpbe_dev;
struct osd_layer_config *cfg = &layer->layer_info.config;
struct osd_state *osd_device = disp_dev->osd_device;
- struct v4l2_rect *rect = &crop->c;
+ struct v4l2_rect rect = crop->c;
int ret;

v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev,
@@ -648,21 +648,21 @@ static int vpbe_display_s_crop(struct file *file, void *priv,
return -EINVAL;
}

- if (rect->top < 0)
- rect->top = 0;
- if (rect->left < 0)
- rect->left = 0;
+ if (rect.top < 0)
+ rect.top = 0;
+ if (rect.left < 0)
+ rect.left = 0;

- vpbe_disp_check_window_params(disp_dev, rect);
+ vpbe_disp_check_window_params(disp_dev, &rect);

osd_device->ops.get_layer_config(osd_device,
layer->layer_info.id, cfg);

vpbe_disp_calculate_scale_factor(disp_dev, layer,
- rect->width,
- rect->height);
- vpbe_disp_adj_position(disp_dev, layer, rect->top,
- rect->left);
+ rect.width,
+ rect.height);
+ vpbe_disp_adj_position(disp_dev, layer, rect.top,
+ rect.left);
ret = osd_device->ops.set_layer_config(osd_device,
layer->layer_info.id, cfg);
if (ret < 0) {
--
1.7.4.1


2012-10-03 06:41:49

by Hans Verkuil

[permalink] [raw]
Subject: Re: [PATCH] media: davinci: vpbe: fix build warning

On Wed October 3 2012 08:27:38 Prabhakar wrote:
> From: Lad, Prabhakar <[email protected]>
>
> recent patch with commit id 4f996594ceaf6c3f9bc42b40c40b0f7f87b79c86
> which makes vidioc_s_crop const, was causing a following build warning,
>
> vpbe_display.c: In function 'vpbe_display_s_crop':
> vpbe_display.c:640: warning: initialization discards qualifiers from pointer target type
>
> This patch fixes the above build warning.

Acked-by: Hans Verkuil <[email protected]>

Prabhaker, can you make a pull request for this patch, the "CUSTOM_TIMINGS"
rename patch and the earlier "vpfe: fix build error" patch? These things
should be fast-tracked.

Regards,

Hans

> Signed-off-by: Lad, Prabhakar <[email protected]>
> Signed-off-by: Manjunath Hadli <[email protected]>
> Cc: Hans Verkuil <[email protected]>
> Cc: Mauro Carvalho Chehab <[email protected]>
> ---
> drivers/media/platform/davinci/vpbe_display.c | 20 ++++++++++----------
> 1 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
> index 1b238fe..161c776 100644
> --- a/drivers/media/platform/davinci/vpbe_display.c
> +++ b/drivers/media/platform/davinci/vpbe_display.c
> @@ -637,7 +637,7 @@ static int vpbe_display_s_crop(struct file *file, void *priv,
> struct vpbe_device *vpbe_dev = disp_dev->vpbe_dev;
> struct osd_layer_config *cfg = &layer->layer_info.config;
> struct osd_state *osd_device = disp_dev->osd_device;
> - struct v4l2_rect *rect = &crop->c;
> + struct v4l2_rect rect = crop->c;
> int ret;
>
> v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev,
> @@ -648,21 +648,21 @@ static int vpbe_display_s_crop(struct file *file, void *priv,
> return -EINVAL;
> }
>
> - if (rect->top < 0)
> - rect->top = 0;
> - if (rect->left < 0)
> - rect->left = 0;
> + if (rect.top < 0)
> + rect.top = 0;
> + if (rect.left < 0)
> + rect.left = 0;
>
> - vpbe_disp_check_window_params(disp_dev, rect);
> + vpbe_disp_check_window_params(disp_dev, &rect);
>
> osd_device->ops.get_layer_config(osd_device,
> layer->layer_info.id, cfg);
>
> vpbe_disp_calculate_scale_factor(disp_dev, layer,
> - rect->width,
> - rect->height);
> - vpbe_disp_adj_position(disp_dev, layer, rect->top,
> - rect->left);
> + rect.width,
> + rect.height);
> + vpbe_disp_adj_position(disp_dev, layer, rect.top,
> + rect.left);
> ret = osd_device->ops.set_layer_config(osd_device,
> layer->layer_info.id, cfg);
> if (ret < 0) {
>

2012-10-03 06:45:41

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [PATCH] media: davinci: vpbe: fix build warning

Hi Hans,

On Wed, Oct 3, 2012 at 12:10 PM, Hans Verkuil <[email protected]> wrote:
> On Wed October 3 2012 08:27:38 Prabhakar wrote:
>> From: Lad, Prabhakar <[email protected]>
>>
>> recent patch with commit id 4f996594ceaf6c3f9bc42b40c40b0f7f87b79c86
>> which makes vidioc_s_crop const, was causing a following build warning,
>>
>> vpbe_display.c: In function 'vpbe_display_s_crop':
>> vpbe_display.c:640: warning: initialization discards qualifiers from pointer target type
>>
>> This patch fixes the above build warning.
>
> Acked-by: Hans Verkuil <[email protected]>
>
> Prabhaker, can you make a pull request for this patch, the "CUSTOM_TIMINGS"
> rename patch and the earlier "vpfe: fix build error" patch? These things
> should be fast-tracked.
>
Yes I will issue a pull request today.

Regards,
--Prabhakar Lad

> Regards,
>
> Hans
>
>> Signed-off-by: Lad, Prabhakar <[email protected]>
>> Signed-off-by: Manjunath Hadli <[email protected]>
>> Cc: Hans Verkuil <[email protected]>
>> Cc: Mauro Carvalho Chehab <[email protected]>
>> ---
>> drivers/media/platform/davinci/vpbe_display.c | 20 ++++++++++----------
>> 1 files changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
>> index 1b238fe..161c776 100644
>> --- a/drivers/media/platform/davinci/vpbe_display.c
>> +++ b/drivers/media/platform/davinci/vpbe_display.c
>> @@ -637,7 +637,7 @@ static int vpbe_display_s_crop(struct file *file, void *priv,
>> struct vpbe_device *vpbe_dev = disp_dev->vpbe_dev;
>> struct osd_layer_config *cfg = &layer->layer_info.config;
>> struct osd_state *osd_device = disp_dev->osd_device;
>> - struct v4l2_rect *rect = &crop->c;
>> + struct v4l2_rect rect = crop->c;
>> int ret;
>>
>> v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev,
>> @@ -648,21 +648,21 @@ static int vpbe_display_s_crop(struct file *file, void *priv,
>> return -EINVAL;
>> }
>>
>> - if (rect->top < 0)
>> - rect->top = 0;
>> - if (rect->left < 0)
>> - rect->left = 0;
>> + if (rect.top < 0)
>> + rect.top = 0;
>> + if (rect.left < 0)
>> + rect.left = 0;
>>
>> - vpbe_disp_check_window_params(disp_dev, rect);
>> + vpbe_disp_check_window_params(disp_dev, &rect);
>>
>> osd_device->ops.get_layer_config(osd_device,
>> layer->layer_info.id, cfg);
>>
>> vpbe_disp_calculate_scale_factor(disp_dev, layer,
>> - rect->width,
>> - rect->height);
>> - vpbe_disp_adj_position(disp_dev, layer, rect->top,
>> - rect->left);
>> + rect.width,
>> + rect.height);
>> + vpbe_disp_adj_position(disp_dev, layer, rect.top,
>> + rect.left);
>> ret = osd_device->ops.set_layer_config(osd_device,
>> layer->layer_info.id, cfg);
>> if (ret < 0) {
>>