Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Dan Carpenter and committed by
Greg Kroah-Hartman
edb2b255 1bfac90d

+1 -1
+1 -1
drivers/usb/core/message.c
··· 435 435 436 436 len = sg->length; 437 437 if (length) { 438 - len = min_t(unsigned, len, length); 438 + len = min_t(size_t, len, length); 439 439 length -= len; 440 440 if (length == 0) 441 441 io->entries = i + 1;