Skip to content

Commit 9a0c58d

Browse files
novitollgregkh
authored andcommitted
drivers/usb/misc: refactor min with min_t
Ensure type safety by using min_t() instead of min(). Also add the explicit `unsigned int` as scripts/checkpatch.pl warns about: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Sabyrzhan Tasbolatov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 982883b commit 9a0c58d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/misc/usbtest.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,8 @@ static struct urb *iso_alloc_urb(
20212021

20222022
for (i = 0; i < packets; i++) {
20232023
/* here, only the last packet will be short */
2024-
urb->iso_frame_desc[i].length = min((unsigned) bytes, maxp);
2024+
urb->iso_frame_desc[i].length = min_t(unsigned int,
2025+
bytes, maxp);
20252026
bytes -= urb->iso_frame_desc[i].length;
20262027

20272028
urb->iso_frame_desc[i].offset = maxp * i;

0 commit comments

Comments
 (0)