mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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/20240429-fix-cocci-v3-4-3c4865f5a4b0@chromium.org Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
c039459368
commit
9a6f13261d
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue