public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc_camera: match signedness of soc_camera_limit_side()
@ 2010-01-23 13:43 Németh Márton
  2010-01-27 16:05 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 12+ messages in thread
From: Németh Márton @ 2010-01-23 13:43 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: V4L Mailing List

From: Márton Németh <nm127@freemail.hu>

The parameters of soc_camera_limit_side() are either a pointer to
a structure element from v4l2_rect, or constants. The structure elements
of the v4l2_rect are signed (see <linux/videodev2.h>) so do the computations
also with signed values.

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>

Signed-off-by: Márton Németh <nm127@freemail.hu>
---
diff -r 2a50a0a1c951 linux/include/media/soc_camera.h
--- a/linux/include/media/soc_camera.h	Sat Jan 23 00:14:32 2010 -0200
+++ b/linux/include/media/soc_camera.h	Sat Jan 23 10:09:41 2010 +0100
@@ -264,9 +264,8 @@
 		common_flags;
 }

-static inline void soc_camera_limit_side(unsigned int *start,
-		unsigned int *length, unsigned int start_min,
-		unsigned int length_min, unsigned int length_max)
+static inline void soc_camera_limit_side(int *start, int *length,
+		int start_min, int length_min, int length_max)
 {
 	if (*length < length_min)
 		*length = length_min;
diff -r 2a50a0a1c951 linux/drivers/media/video/rj54n1cb0c.c
--- a/linux/drivers/media/video/rj54n1cb0c.c	Sat Jan 23 00:14:32 2010 -0200
+++ b/linux/drivers/media/video/rj54n1cb0c.c	Sat Jan 23 10:09:41 2010 +0100
@@ -555,15 +555,15 @@
 	return ret;
 }

-static int rj54n1_sensor_scale(struct v4l2_subdev *sd, u32 *in_w, u32 *in_h,
-			       u32 *out_w, u32 *out_h);
+static int rj54n1_sensor_scale(struct v4l2_subdev *sd, s32 *in_w, s32 *in_h,
+			       s32 *out_w, s32 *out_h);

 static int rj54n1_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
 {
 	struct i2c_client *client = sd->priv;
 	struct rj54n1 *rj54n1 = to_rj54n1(client);
 	struct v4l2_rect *rect = &a->c;
-	unsigned int dummy = 0, output_w, output_h,
+	int dummy = 0, output_w, output_h,
 		input_w = rect->width, input_h = rect->height;
 	int ret;

@@ -638,8 +638,8 @@
  * the output one, updates the window sizes and returns an error or the resize
  * coefficient on success. Note: we only use the "Fixed Scaling" on this camera.
  */
-static int rj54n1_sensor_scale(struct v4l2_subdev *sd, u32 *in_w, u32 *in_h,
-			       u32 *out_w, u32 *out_h)
+static int rj54n1_sensor_scale(struct v4l2_subdev *sd, s32 *in_w, s32 *in_h,
+			       s32 *out_w, s32 *out_h)
 {
 	struct i2c_client *client = sd->priv;
 	struct rj54n1 *rj54n1 = to_rj54n1(client);
@@ -1017,7 +1017,7 @@
 	struct i2c_client *client = sd->priv;
 	struct rj54n1 *rj54n1 = to_rj54n1(client);
 	const struct rj54n1_datafmt *fmt;
-	unsigned int output_w, output_h, max_w, max_h,
+	int output_w, output_h, max_w, max_h,
 		input_w = rj54n1->rect.width, input_h = rj54n1->rect.height;
 	int ret;



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-02-24  6:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-23 13:43 [PATCH] soc_camera: match signedness of soc_camera_limit_side() Németh Márton
2010-01-27 16:05 ` Guennadi Liakhovetski
2010-01-27 18:11   ` Németh Márton
2010-01-27 18:22     ` Guennadi Liakhovetski
2010-01-27 19:58       ` Németh Márton
2010-01-27 20:12         ` Guennadi Liakhovetski
2010-01-27 21:42           ` Németh Márton
2010-01-28 20:52             ` Guennadi Liakhovetski
2010-01-28 21:30               ` Németh Márton
2010-02-09  9:05                 ` Guennadi Liakhovetski
2010-02-12  9:32                   ` Guennadi Liakhovetski
2010-02-24  6:32                     ` Németh Márton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox