Skip to content

Commit

Permalink
staging: bcm2835-camera: Replace ternary operator with min_t macro
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Narcisa Ana Maria Vasile authored and Greg Kroah-Hartman committed Mar 7, 2017
1 parent fb1e876 commit 85fa002
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 85fa002

Please sign in to comment.