This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: uvcvideo: Use max() macro
Author:  Ricardo Ribalda <[email protected]>
Date:    Mon Apr 29 16:04:43 2024 +0100

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]>

 drivers/media/usb/uvc/uvc_ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

---

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;
 

Reply via email to