aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Ribalda <[email protected]>2024-04-29 16:04:43 +0100
committerMauro Carvalho Chehab <[email protected]>2024-05-03 11:06:06 +0100
commit9a6f13261d9b2e49342acea70888aaffc9eede19 (patch)
tree8e8fa40149617845ba26b75e467bfa288c7d714a
parentc039459368266d32b94e7e355a7b905b6c029866 (diff)
media: uvcvideo: Use max() macro
It makes the code slightly more clear and makes cocci incredibly happy: drivers/media/usb/uvc/uvc_ctrl.c:839:22-23: WARNING opportunity for max() Link: https://lore.kernel.org/linux-media/[email protected] Reviewed-by: Sergey Senozhatsky <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/media/usb/uvc/uvc_ctrl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index e59a463c2761..f8ae14b8b426 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -836,7 +836,7 @@ static s32 uvc_get_le_value(struct uvc_control_mapping *mapping,
while (1) {
u8 byte = *data & mask;
value |= offset > 0 ? (byte >> offset) : (byte << (-offset));
- bits -= 8 - (offset > 0 ? offset : 0);
+ bits -= 8 - max(offset, 0);
if (bits <= 0)
break;