staging: bcm2835-camera: Replace ternary operator with min_t macro
authorNarcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Tue, 7 Mar 2017 15:22:03 +0000 (17:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 7 Mar 2017 19:11:38 +0000 (20:11 +0100)
Use macro min_t to get the minimum of two values for readability.

Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c

index c9a68d4ebd158f75eeaf54701ef99fc26c6a85f3..ab853441b8096d1c8b58b9e031298b66a71b111a 100644 (file)
@@ -1539,9 +1539,7 @@ static int get_num_cameras(struct vchiq_mmal_instance *instance,
                pr_info("Failed to get camera info\n");
        }
        for (i = 0;
-            i < (cam_info.num_cameras > num_resolutions ?
-                       num_resolutions :
-                       cam_info.num_cameras);
+            i < min_t(unsigned int, cam_info.num_cameras, num_resolutions);
             i++) {
                resolutions[i][0] = cam_info.cameras[i].max_width;
                resolutions[i][1] = cam_info.cameras[i].max_height;