Skip to content

Commit 657f5bc

Browse files
ribaldamchehab
authored andcommitted
media: au0828: Use umin macro
Simplifies the code. Found by cocci: drivers/media/usb/au0828/au0828-video.c:605:11-12: WARNING opportunity for min() Link: https://lore.kernel.org/linux-media/20240429-fix-cocci-v3-16-3c4865f5a4b0@chromium.org Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent f2ccb53 commit 657f5bc

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/media/usb/au0828/au0828-video.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,10 +602,7 @@ static inline int au0828_isoc_copy(struct au0828_dev *dev, struct urb *urb)
602602
vbi_field_size = dev->vbi_width * dev->vbi_height * 2;
603603
if (dev->vbi_read < vbi_field_size) {
604604
remain = vbi_field_size - dev->vbi_read;
605-
if (len < remain)
606-
lencopy = len;
607-
else
608-
lencopy = remain;
605+
lencopy = umin(len, remain);
609606

610607
if (vbi_buf != NULL)
611608
au0828_copy_vbi(dev, vbi_dma_q, vbi_buf, p,

0 commit comments

Comments
 (0)