提交 85fa002f 编写于 作者: N Narcisa Ana Maria Vasile 提交者: Greg Kroah-Hartman

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: NNarcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 fb1e8765
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册