projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
657f5bc
)
media: flexcop-usb: Use min macro
author
Ricardo Ribalda
<ribalda@chromium.org>
Mon, 29 Apr 2024 15:04:56 +0000
(16:04 +0100)
committer
Mauro Carvalho Chehab
<mchehab@kernel.org>
Fri, 3 May 2024 10:13:24 +0000
(11:13 +0100)
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>
drivers/media/usb/b2c2/flexcop-usb.c
patch
|
blob
|
history
diff --git
a/drivers/media/usb/b2c2/flexcop-usb.c
b/drivers/media/usb/b2c2/flexcop-usb.c
index 43dd3c932a85c7e0dfe1d3f42d3a73e52b62db65..90f1aea99dac054e0917e77a595980332d68263a 100644
(file)
--- a/
drivers/media/usb/b2c2/flexcop-usb.c
+++ b/
drivers/media/usb/b2c2/flexcop-usb.c
@@
-197,10
+197,7
@@
static int flexcop_usb_memory_req(struct flexcop_usb *fc_usb,
return -EINVAL;
}
for (i = 0; i < len;) {
- pagechunk =
- wMax < bytes_left_to_read_on_page(addr, len) ?
- wMax :
- bytes_left_to_read_on_page(addr, len);
+ pagechunk = min(wMax, bytes_left_to_read_on_page(addr, len));
deb_info("%x\n",
(addr & V8_MEMORY_PAGE_MASK) |
(V8_MEMORY_EXTENDED*extended));