aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-03-03 19:44:13 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-24 19:20:36 -0400
commit16e2e5f634f86ccda18366967c4e592eb61bc9cc (patch)
treec736a81517e929559c83cc5eb9fb6f4d04458571 /drivers/usb/misc
parent7ea0a2bcfe40b1c525e63e931b7142ab22b64269 (diff)
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>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r--drivers/usb/misc/ftdi-elan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index 79a7668ef264..9d0675ed0d4c 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -1568,7 +1568,7 @@ static int ftdi_elan_edset_input(struct usb_ftdi *ftdi, u8 ed_number,
1568 struct u132_target *target = &ftdi->target[ed]; 1568 struct u132_target *target = &ftdi->target[ed];
1569 struct u132_command *command = &ftdi->command[ 1569 struct u132_command *command = &ftdi->command[
1570 COMMAND_MASK & ftdi->command_next]; 1570 COMMAND_MASK & ftdi->command_next];
1571 int remaining_length = urb->transfer_buffer_length - 1571 u32 remaining_length = urb->transfer_buffer_length -
1572 urb->actual_length; 1572 urb->actual_length;
1573 command->header = 0x82 | (ed << 5); 1573 command->header = 0x82 | (ed << 5);
1574 if (remaining_length == 0) { 1574 if (remaining_length == 0) {
@@ -1702,7 +1702,7 @@ static int ftdi_elan_edset_output(struct usb_ftdi *ftdi, u8 ed_number,
1702 | (address << 0); 1702 | (address << 0);
1703 command->width = usb_maxpacket(urb->dev, urb->pipe, 1703 command->width = usb_maxpacket(urb->dev, urb->pipe,
1704 usb_pipeout(urb->pipe)); 1704 usb_pipeout(urb->pipe));
1705 command->follows = min(1024, 1705 command->follows = min_t(u32, 1024,
1706 urb->transfer_buffer_length - 1706 urb->transfer_buffer_length -
1707 urb->actual_length); 1707 urb->actual_length);
1708 command->value = 0; 1708 command->value = 0;
@@ -1766,7 +1766,7 @@ static int ftdi_elan_edset_single(struct usb_ftdi *ftdi, u8 ed_number,
1766 mutex_lock(&ftdi->u132_lock); 1766 mutex_lock(&ftdi->u132_lock);
1767 command_size = ftdi->command_next - ftdi->command_head; 1767 command_size = ftdi->command_next - ftdi->command_head;
1768 if (command_size < COMMAND_SIZE) { 1768 if (command_size < COMMAND_SIZE) {
1769 int remaining_length = urb->transfer_buffer_length - 1769 u32 remaining_length = urb->transfer_buffer_length -
1770 urb->actual_length; 1770 urb->actual_length;
1771 struct u132_target *target = &ftdi->target[ed]; 1771 struct u132_target *target = &ftdi->target[ed];
1772 struct u132_command *command = &ftdi->command[ 1772 struct u132_command *command = &ftdi->command[