Skip to content

Commit 4801655

Browse files
ribaldamchehab
authored andcommitted
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/[email protected] Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 657f5bc commit 4801655

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/media/usb/b2c2/flexcop-usb.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,7 @@ static int flexcop_usb_memory_req(struct flexcop_usb *fc_usb,
197197
return -EINVAL;
198198
}
199199
for (i = 0; i < len;) {
200-
pagechunk =
201-
wMax < bytes_left_to_read_on_page(addr, len) ?
202-
wMax :
203-
bytes_left_to_read_on_page(addr, len);
200+
pagechunk = min(wMax, bytes_left_to_read_on_page(addr, len));
204201
deb_info("%x\n",
205202
(addr & V8_MEMORY_PAGE_MASK) |
206203
(V8_MEMORY_EXTENDED*extended));

0 commit comments

Comments
 (0)