From: Narcisa Ana Maria Vasile Date: Tue, 7 Mar 2017 15:22:03 +0000 (+0200) Subject: staging: bcm2835-camera: Replace ternary operator with min_t macro X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=85fa002f2e9102ba3305c419badc9871ca3b1ae0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: bcm2835-camera: Replace ternary operator with min_t macro Use macro min_t to get the minimum of two values for readability. Signed-off-by: Narcisa Ana Maria Vasile Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index c9a68d4ebd15..ab853441b809 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -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;