[media] smiapp: Scaling goodness is signed
authorSakari Ailus <sakari.ailus@linux.intel.com>
Tue, 15 Apr 2014 18:22:11 +0000 (15:22 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Fri, 23 May 2014 14:30:22 +0000 (11:30 -0300)
The "best" value was unsigned however, leading to signed-to-unsigned
comparison and wrong results. Possibly only on a newer GCC. Fix this by
making the best value signed as well.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/i2c/smiapp/smiapp-core.c

index 0a74e145e1d2fe7c7adf56ad7499a2c8c01510e2..db3d5a64d2ca358a1bccb406f1bf433c41a09fbc 100644 (file)
@@ -1766,7 +1766,7 @@ static void smiapp_set_compose_binner(struct v4l2_subdev *subdev,
        struct smiapp_sensor *sensor = to_smiapp_sensor(subdev);
        unsigned int i;
        unsigned int binh = 1, binv = 1;
-       unsigned int best = scaling_goodness(
+       int best = scaling_goodness(
                subdev,
                crops[SMIAPP_PAD_SINK]->width, sel->r.width,
                crops[SMIAPP_PAD_SINK]->height, sel->r.height, sel->flags);