summaryrefslogtreecommitdiff
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorRicardo Ribalda <ribalda@chromium.org>2024-04-29 18:04:55 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2024-05-03 13:13:02 +0300
commit657f5bca97af98a3da6c0d0c2a51f1f9be9b0e41 (patch)
tree1827b8aa78a407c3632c09077749478bb193302f /drivers/media/usb
parentf2ccb530c5f9bebb0793d4f173a27ad709fcabc4 (diff)
downloadlinux-657f5bca97af98a3da6c0d0c2a51f1f9be9b0e41.tar.xz
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>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/au0828/au0828-video.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index fd9fc43d47e0..2ec49ea479d5 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -602,10 +602,7 @@ static inline int au0828_isoc_copy(struct au0828_dev *dev, struct urb *urb)
vbi_field_size = dev->vbi_width * dev->vbi_height * 2;
if (dev->vbi_read < vbi_field_size) {
remain = vbi_field_size - dev->vbi_read;
- if (len < remain)
- lencopy = len;
- else
- lencopy = remain;
+ lencopy = umin(len, remain);
if (vbi_buf != NULL)
au0828_copy_vbi(dev, vbi_dma_q, vbi_buf, p,