mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 07:10:27 +00:00
media: flexcop-usb: Use min macro
Simplifies the code. Found by cocci: drivers/media/usb/b2c2/flexcop-usb.c:201:8-9: WARNING opportunity for min() Link: https://lore.kernel.org/linux-media/20240429-fix-cocci-v3-17-3c4865f5a4b0@chromium.org Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
657f5bca97
commit
48016551e0
@ -197,10 +197,7 @@ static int flexcop_usb_memory_req(struct flexcop_usb *fc_usb,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
for (i = 0; i < len;) {
|
for (i = 0; i < len;) {
|
||||||
pagechunk =
|
pagechunk = min(wMax, bytes_left_to_read_on_page(addr, len));
|
||||||
wMax < bytes_left_to_read_on_page(addr, len) ?
|
|
||||||
wMax :
|
|
||||||
bytes_left_to_read_on_page(addr, len);
|
|
||||||
deb_info("%x\n",
|
deb_info("%x\n",
|
||||||
(addr & V8_MEMORY_PAGE_MASK) |
|
(addr & V8_MEMORY_PAGE_MASK) |
|
||||||
(V8_MEMORY_EXTENDED*extended));
|
(V8_MEMORY_EXTENDED*extended));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user