Skip to content

Commit edb2b25

Browse files
Dan Carpentergregkh
Dan Carpenter
authored andcommitted
USB: message: cleanup min_t() cast in usb_sg_init()
"length" is type size_t so the cast to unsigned int truncates the upper bytes. This isn't an issue in real life (I've checked the callers) but it's a bit messy. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1bfac90 commit edb2b25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/core/message.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev,
435435

436436
len = sg->length;
437437
if (length) {
438-
len = min_t(unsigned, len, length);
438+
len = min_t(size_t, len, length);
439439
length -= len;
440440
if (length == 0)
441441
io->entries = i + 1;

0 commit comments

Comments
 (0)