USB: make transfer_buffer_lengths in struct urb field u32
Roel Kluin pointed out that transfer_buffer_lengths in struct urb was declared as an 'int'. This patch changes this field to be 'u32' to prevent any potential negative conversion and comparison errors. This triggered a few compiler warning messages when these fields were being used with the min macro, so they have also been fixed up in this patch. Cc: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
@@ -230,7 +230,7 @@ static void in_packet(
|
||||
writeb(usb_pipedevice(urb->pipe), data_reg);
|
||||
|
||||
sl811_write(sl811, bank + SL11H_HOSTCTLREG, control);
|
||||
ep->length = min((int)len,
|
||||
ep->length = min_t(u32, len,
|
||||
urb->transfer_buffer_length - urb->actual_length);
|
||||
PACKET("IN%s/%d qh%p len%d\n", ep->nak_count ? "/retry" : "",
|
||||
!!usb_gettoggle(urb->dev, ep->epnum, 0), ep, len);
|
||||
@@ -255,7 +255,7 @@ static void out_packet(
|
||||
buf = urb->transfer_buffer + urb->actual_length;
|
||||
prefetch(buf);
|
||||
|
||||
len = min((int)ep->maxpacket,
|
||||
len = min_t(u32, ep->maxpacket,
|
||||
urb->transfer_buffer_length - urb->actual_length);
|
||||
|
||||
if (!(control & SL11H_HCTLMASK_ISOCH)
|
||||
|
Reference in New Issue
Block a user