]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/media/i2c/tvp5150.c
Merge tag 'staging-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[karo-tx-linux.git] / drivers / media / i2c / tvp5150.c
index 2ed05b67218b5484fd9093949d61499203ee301a..542d2528b3f913767c37db19512303dbed2e76b2 100644 (file)
@@ -863,7 +863,7 @@ static int tvp5150_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
        struct v4l2_rect rect = a->c;
        struct tvp5150 *decoder = to_tvp5150(sd);
        v4l2_std_id std;
-       int hmax;
+       unsigned int hmax;
 
        v4l2_dbg(1, debug, sd, "%s left=%d, top=%d, width=%d, height=%d\n",
                __func__, rect.left, rect.top, rect.width, rect.height);
@@ -873,9 +873,9 @@ static int tvp5150_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
 
        /* tvp5150 has some special limits */
        rect.left = clamp(rect.left, 0, TVP5150_MAX_CROP_LEFT);
-       rect.width = clamp(rect.width,
-                          TVP5150_H_MAX - TVP5150_MAX_CROP_LEFT - rect.left,
-                          TVP5150_H_MAX - rect.left);
+       rect.width = clamp_t(unsigned int, rect.width,
+                            TVP5150_H_MAX - TVP5150_MAX_CROP_LEFT - rect.left,
+                            TVP5150_H_MAX - rect.left);
        rect.top = clamp(rect.top, 0, TVP5150_MAX_CROP_TOP);
 
        /* Calculate height based on current standard */
@@ -889,9 +889,9 @@ static int tvp5150_s_crop(struct v4l2_subdev *sd, const struct v4l2_crop *a)
        else
                hmax = TVP5150_V_MAX_OTHERS;
 
-       rect.height = clamp(rect.height,
-                           hmax - TVP5150_MAX_CROP_TOP - rect.top,
-                           hmax - rect.top);
+       rect.height = clamp_t(unsigned int, rect.height,
+                             hmax - TVP5150_MAX_CROP_TOP - rect.top,
+                             hmax - rect.top);
 
        tvp5150_write(sd, TVP5150_VERT_BLANKING_START, rect.top);
        tvp5150_write(sd, TVP5150_VERT_BLANKING_STOP,