USB: message: cleanup min_t() cast in usb_sg_init()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 27 Sep 2011 06:25:19 +0000 (09:25 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 29 Sep 2011 20:13:07 +0000 (13:13 -0700)
"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>
drivers/usb/core/message.c

index 0b5ec234c787ff907cf677c25dbf4f407a418642..b3bdfede45e68721376c381a42950044da9625ad 100644 (file)
@@ -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;