]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: staging: bcm2835-camera: use V4L2_FRACT_COMPARE
authorAkinobu Mita <akinobu.mita@gmail.com>
Sun, 30 Dec 2018 13:20:16 +0000 (08:20 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 16 Jan 2019 16:31:43 +0000 (11:31 -0500)
Now the equivalent of FRACT_CMP() is added in v4l2 common internal API
header.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c

index 611a6ee2943a3d4d6a3832b79b7175697445adf8..7c6cf41645ebe9441c457a6cc7965c704c596619 100644 (file)
@@ -1370,10 +1370,6 @@ static int vidioc_g_parm(struct file *file, void *priv,
        return 0;
 }
 
-#define FRACT_CMP(a, OP, b)    \
-       ((u64)(a).numerator * (b).denominator  OP  \
-        (u64)(b).numerator * (a).denominator)
-
 static int vidioc_s_parm(struct file *file, void *priv,
                         struct v4l2_streamparm *parm)
 {
@@ -1387,8 +1383,8 @@ static int vidioc_s_parm(struct file *file, void *priv,
 
        /* tpf: {*, 0} resets timing; clip to [min, max]*/
        tpf = tpf.denominator ? tpf : tpf_default;
-       tpf = FRACT_CMP(tpf, <, tpf_min) ? tpf_min : tpf;
-       tpf = FRACT_CMP(tpf, >, tpf_max) ? tpf_max : tpf;
+       tpf = V4L2_FRACT_COMPARE(tpf, <, tpf_min) ? tpf_min : tpf;
+       tpf = V4L2_FRACT_COMPARE(tpf, >, tpf_max) ? tpf_max : tpf;
 
        dev->capture.timeperframe = tpf;
        parm->parm.capture.timeperframe = tpf;