media: uvcvideo: Use clamp() to replace manual implementation
The kernel has a nice clamp() macro, use it to replace a manual implementation based on min() and max(). No functional change is intended. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
aa8db3adc7
commit
7c5dfb2d91
|
@ -437,9 +437,9 @@ static int uvc_parse_format(struct uvc_device *dev,
|
|||
*/
|
||||
n -= frame->bFrameIntervalType ? 1 : 2;
|
||||
frame->dwDefaultFrameInterval =
|
||||
min(frame->dwFrameInterval[n],
|
||||
max(frame->dwFrameInterval[0],
|
||||
frame->dwDefaultFrameInterval));
|
||||
clamp(frame->dwDefaultFrameInterval,
|
||||
frame->dwFrameInterval[0],
|
||||
frame->dwFrameInterval[n]);
|
||||
|
||||
if (dev->quirks & UVC_QUIRK_RESTRICT_FRAME_RATE) {
|
||||
frame->bFrameIntervalType = 1;
|
||||
|
|
Loading…
Reference in New Issue