diff options
author | Márton Németh <nm127@freemail.hu> | 2010-02-24 15:13:29 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-17 23:44:09 -0400 |
commit | e26b31449142a18512b57dbea515af234992ba7c (patch) | |
tree | f3918a70f6ed82a04627517605d5377a047ad836 | |
parent | 02512fe33e9162713cd522937aabc81fcd97ad74 (diff) |
V4L/DVB: The first two parameters of soc_camera_limit_side() are usually pointers to struct v4l2_rect elements. They are signed, so adjust the prototype accordingly
This will remove the following sparse warning (see "make C=1"):
* incorrect type in argument 1 (different signedness)
expected unsigned int *start
got signed int *<noident>
as well as a couple more signedness mismatches.
Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/mt9v022.c | 2 | ||||
-rw-r--r-- | drivers/media/video/mx3_camera.c | 4 | ||||
-rw-r--r-- | drivers/media/video/rj54n1cb0c.c | 18 | ||||
-rw-r--r-- | drivers/media/video/sh_mobile_ceu_camera.c | 8 | ||||
-rw-r--r-- | include/media/soc_camera.h | 4 |
5 files changed, 18 insertions, 18 deletions
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c index 1a34d2993e94..e5bae4c9393b 100644 --- a/drivers/media/video/mt9v022.c +++ b/drivers/media/video/mt9v022.c | |||
@@ -325,7 +325,7 @@ static int mt9v022_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) | |||
325 | if (ret < 0) | 325 | if (ret < 0) |
326 | return ret; | 326 | return ret; |
327 | 327 | ||
328 | dev_dbg(&client->dev, "Frame %ux%u pixel\n", rect.width, rect.height); | 328 | dev_dbg(&client->dev, "Frame %dx%d pixel\n", rect.width, rect.height); |
329 | 329 | ||
330 | mt9v022->rect = rect; | 330 | mt9v022->rect = rect; |
331 | 331 | ||
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c index bd297f567dc7..d477e3058002 100644 --- a/drivers/media/video/mx3_camera.c +++ b/drivers/media/video/mx3_camera.c | |||
@@ -796,7 +796,7 @@ static int acquire_dma_channel(struct mx3_camera_dev *mx3_cam) | |||
796 | * FIXME: learn to use stride != width, then we can keep stride properly aligned | 796 | * FIXME: learn to use stride != width, then we can keep stride properly aligned |
797 | * and support arbitrary (even) widths. | 797 | * and support arbitrary (even) widths. |
798 | */ | 798 | */ |
799 | static inline void stride_align(__s32 *width) | 799 | static inline void stride_align(__u32 *width) |
800 | { | 800 | { |
801 | if (((*width + 7) & ~7) < 4096) | 801 | if (((*width + 7) & ~7) < 4096) |
802 | *width = (*width + 7) & ~7; | 802 | *width = (*width + 7) & ~7; |
@@ -844,7 +844,7 @@ static int mx3_camera_set_crop(struct soc_camera_device *icd, | |||
844 | * So far only direct camera-to-memory is supported | 844 | * So far only direct camera-to-memory is supported |
845 | */ | 845 | */ |
846 | if (channel_change_requested(icd, rect)) { | 846 | if (channel_change_requested(icd, rect)) { |
847 | int ret = acquire_dma_channel(mx3_cam); | 847 | ret = acquire_dma_channel(mx3_cam); |
848 | if (ret < 0) | 848 | if (ret < 0) |
849 | return ret; | 849 | return ret; |
850 | } | 850 | } |
diff --git a/drivers/media/video/rj54n1cb0c.c b/drivers/media/video/rj54n1cb0c.c index 9277194cd821..bbd9c11e2c5a 100644 --- a/drivers/media/video/rj54n1cb0c.c +++ b/drivers/media/video/rj54n1cb0c.c | |||
@@ -555,15 +555,15 @@ static int rj54n1_commit(struct i2c_client *client) | |||
555 | return ret; | 555 | return ret; |
556 | } | 556 | } |
557 | 557 | ||
558 | static int rj54n1_sensor_scale(struct v4l2_subdev *sd, u32 *in_w, u32 *in_h, | 558 | static int rj54n1_sensor_scale(struct v4l2_subdev *sd, s32 *in_w, s32 *in_h, |
559 | u32 *out_w, u32 *out_h); | 559 | s32 *out_w, s32 *out_h); |
560 | 560 | ||
561 | static int rj54n1_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) | 561 | static int rj54n1_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) |
562 | { | 562 | { |
563 | struct i2c_client *client = sd->priv; | 563 | struct i2c_client *client = sd->priv; |
564 | struct rj54n1 *rj54n1 = to_rj54n1(client); | 564 | struct rj54n1 *rj54n1 = to_rj54n1(client); |
565 | struct v4l2_rect *rect = &a->c; | 565 | struct v4l2_rect *rect = &a->c; |
566 | unsigned int dummy = 0, output_w, output_h, | 566 | int dummy = 0, output_w, output_h, |
567 | input_w = rect->width, input_h = rect->height; | 567 | input_w = rect->width, input_h = rect->height; |
568 | int ret; | 568 | int ret; |
569 | 569 | ||
@@ -577,7 +577,7 @@ static int rj54n1_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a) | |||
577 | output_w = (input_w * 1024 + rj54n1->resize / 2) / rj54n1->resize; | 577 | output_w = (input_w * 1024 + rj54n1->resize / 2) / rj54n1->resize; |
578 | output_h = (input_h * 1024 + rj54n1->resize / 2) / rj54n1->resize; | 578 | output_h = (input_h * 1024 + rj54n1->resize / 2) / rj54n1->resize; |
579 | 579 | ||
580 | dev_dbg(&client->dev, "Scaling for %ux%u : %u = %ux%u\n", | 580 | dev_dbg(&client->dev, "Scaling for %dx%d : %u = %dx%d\n", |
581 | input_w, input_h, rj54n1->resize, output_w, output_h); | 581 | input_w, input_h, rj54n1->resize, output_w, output_h); |
582 | 582 | ||
583 | ret = rj54n1_sensor_scale(sd, &input_w, &input_h, &output_w, &output_h); | 583 | ret = rj54n1_sensor_scale(sd, &input_w, &input_h, &output_w, &output_h); |
@@ -638,8 +638,8 @@ static int rj54n1_g_fmt(struct v4l2_subdev *sd, | |||
638 | * the output one, updates the window sizes and returns an error or the resize | 638 | * the output one, updates the window sizes and returns an error or the resize |
639 | * coefficient on success. Note: we only use the "Fixed Scaling" on this camera. | 639 | * coefficient on success. Note: we only use the "Fixed Scaling" on this camera. |
640 | */ | 640 | */ |
641 | static int rj54n1_sensor_scale(struct v4l2_subdev *sd, u32 *in_w, u32 *in_h, | 641 | static int rj54n1_sensor_scale(struct v4l2_subdev *sd, s32 *in_w, s32 *in_h, |
642 | u32 *out_w, u32 *out_h) | 642 | s32 *out_w, s32 *out_h) |
643 | { | 643 | { |
644 | struct i2c_client *client = sd->priv; | 644 | struct i2c_client *client = sd->priv; |
645 | struct rj54n1 *rj54n1 = to_rj54n1(client); | 645 | struct rj54n1 *rj54n1 = to_rj54n1(client); |
@@ -749,7 +749,7 @@ static int rj54n1_sensor_scale(struct v4l2_subdev *sd, u32 *in_w, u32 *in_h, | |||
749 | * improve the image quality or stability for larger frames (see comment | 749 | * improve the image quality or stability for larger frames (see comment |
750 | * above), but I didn't check the framerate. | 750 | * above), but I didn't check the framerate. |
751 | */ | 751 | */ |
752 | skip = min(resize / 1024, (unsigned)15); | 752 | skip = min(resize / 1024, 15U); |
753 | 753 | ||
754 | inc_sel = 1 << skip; | 754 | inc_sel = 1 << skip; |
755 | 755 | ||
@@ -819,7 +819,7 @@ static int rj54n1_sensor_scale(struct v4l2_subdev *sd, u32 *in_w, u32 *in_h, | |||
819 | *out_w = output_w; | 819 | *out_w = output_w; |
820 | *out_h = output_h; | 820 | *out_h = output_h; |
821 | 821 | ||
822 | dev_dbg(&client->dev, "Scaled for %ux%u : %u = %ux%u, skip %u\n", | 822 | dev_dbg(&client->dev, "Scaled for %dx%d : %u = %ux%u, skip %u\n", |
823 | *in_w, *in_h, resize, output_w, output_h, skip); | 823 | *in_w, *in_h, resize, output_w, output_h, skip); |
824 | 824 | ||
825 | return resize; | 825 | return resize; |
@@ -1017,7 +1017,7 @@ static int rj54n1_s_fmt(struct v4l2_subdev *sd, | |||
1017 | struct i2c_client *client = sd->priv; | 1017 | struct i2c_client *client = sd->priv; |
1018 | struct rj54n1 *rj54n1 = to_rj54n1(client); | 1018 | struct rj54n1 *rj54n1 = to_rj54n1(client); |
1019 | const struct rj54n1_datafmt *fmt; | 1019 | const struct rj54n1_datafmt *fmt; |
1020 | unsigned int output_w, output_h, max_w, max_h, | 1020 | int output_w, output_h, max_w, max_h, |
1021 | input_w = rj54n1->rect.width, input_h = rj54n1->rect.height; | 1021 | input_w = rj54n1->rect.width, input_h = rj54n1->rect.height; |
1022 | int ret; | 1022 | int ret; |
1023 | 1023 | ||
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index 1ad980f8e770..7a229ebe6923 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c | |||
@@ -1041,13 +1041,13 @@ static int client_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *crop, | |||
1041 | */ | 1041 | */ |
1042 | if (!memcmp(rect, cam_rect, sizeof(*rect))) { | 1042 | if (!memcmp(rect, cam_rect, sizeof(*rect))) { |
1043 | /* Even if camera S_CROP failed, but camera rectangle matches */ | 1043 | /* Even if camera S_CROP failed, but camera rectangle matches */ |
1044 | dev_dbg(dev, "Camera S_CROP successful for %ux%u@%u:%u\n", | 1044 | dev_dbg(dev, "Camera S_CROP successful for %dx%d@%d:%d\n", |
1045 | rect->width, rect->height, rect->left, rect->top); | 1045 | rect->width, rect->height, rect->left, rect->top); |
1046 | return 0; | 1046 | return 0; |
1047 | } | 1047 | } |
1048 | 1048 | ||
1049 | /* Try to fix cropping, that camera hasn't managed to set */ | 1049 | /* Try to fix cropping, that camera hasn't managed to set */ |
1050 | dev_geo(dev, "Fix camera S_CROP for %ux%u@%u:%u to %ux%u@%u:%u\n", | 1050 | dev_geo(dev, "Fix camera S_CROP for %dx%d@%d:%d to %dx%d@%d:%d\n", |
1051 | cam_rect->width, cam_rect->height, | 1051 | cam_rect->width, cam_rect->height, |
1052 | cam_rect->left, cam_rect->top, | 1052 | cam_rect->left, cam_rect->top, |
1053 | rect->width, rect->height, rect->left, rect->top); | 1053 | rect->width, rect->height, rect->left, rect->top); |
@@ -1103,7 +1103,7 @@ static int client_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *crop, | |||
1103 | 1103 | ||
1104 | v4l2_subdev_call(sd, video, s_crop, cam_crop); | 1104 | v4l2_subdev_call(sd, video, s_crop, cam_crop); |
1105 | ret = client_g_rect(sd, cam_rect); | 1105 | ret = client_g_rect(sd, cam_rect); |
1106 | dev_geo(dev, "Camera S_CROP %d for %ux%u@%u:%u\n", ret, | 1106 | dev_geo(dev, "Camera S_CROP %d for %dx%d@%d:%d\n", ret, |
1107 | cam_rect->width, cam_rect->height, | 1107 | cam_rect->width, cam_rect->height, |
1108 | cam_rect->left, cam_rect->top); | 1108 | cam_rect->left, cam_rect->top); |
1109 | } | 1109 | } |
@@ -1117,7 +1117,7 @@ static int client_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *crop, | |||
1117 | *cam_rect = cap.bounds; | 1117 | *cam_rect = cap.bounds; |
1118 | v4l2_subdev_call(sd, video, s_crop, cam_crop); | 1118 | v4l2_subdev_call(sd, video, s_crop, cam_crop); |
1119 | ret = client_g_rect(sd, cam_rect); | 1119 | ret = client_g_rect(sd, cam_rect); |
1120 | dev_geo(dev, "Camera S_CROP %d for max %ux%u@%u:%u\n", ret, | 1120 | dev_geo(dev, "Camera S_CROP %d for max %dx%d@%d:%d\n", ret, |
1121 | cam_rect->width, cam_rect->height, | 1121 | cam_rect->width, cam_rect->height, |
1122 | cam_rect->left, cam_rect->top); | 1122 | cam_rect->left, cam_rect->top); |
1123 | } | 1123 | } |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 9d69f01b6fa2..5a173652cf4a 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -266,8 +266,8 @@ static inline unsigned long soc_camera_bus_param_compatible( | |||
266 | common_flags; | 266 | common_flags; |
267 | } | 267 | } |
268 | 268 | ||
269 | static inline void soc_camera_limit_side(unsigned int *start, | 269 | static inline void soc_camera_limit_side(int *start, int *length, |
270 | unsigned int *length, unsigned int start_min, | 270 | unsigned int start_min, |
271 | unsigned int length_min, unsigned int length_max) | 271 | unsigned int length_min, unsigned int length_max) |
272 | { | 272 | { |
273 | if (*length < length_min) | 273 | if (*length < length_min) |