Skip to content

Commit

Permalink
USB: message: cleanup min_t() cast in usb_sg_init()
Browse files Browse the repository at this point in the history
"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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Sep 29, 2011
1 parent 1bfac90 commit edb2b25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit edb2b25

Please sign in to comment.