From: Dan Carpenter Date: Tue, 27 Sep 2011 06:25:19 +0000 (+0300) Subject: USB: message: cleanup min_t() cast in usb_sg_init() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=edb2b255a0bebac5aeb17c7613aeb76ba4e6c63c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 0b5ec234c787..b3bdfede45e6 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -435,7 +435,7 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, len = sg->length; if (length) { - len = min_t(unsigned, len, length); + len = min_t(size_t, len, length); length -= len; if (length == 0) io->entries = i + 1;