diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-10-09 12:24:49 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-10-17 14:46:31 -0700 |
commit | 96a518928e1fd00a6d0eb344f420ea82aeec8ab9 (patch) | |
tree | b9482d646329df33edd77dc85041b5fd5613bf2b /drivers/usb | |
parent | 516077c1ee8a4a47cc41634a29954b636f3975ea (diff) | |
download | op-kernel-dev-96a518928e1fd00a6d0eb344f420ea82aeec8ab9.zip op-kernel-dev-96a518928e1fd00a6d0eb344f420ea82aeec8ab9.tar.gz |
USB: ftdi-elan: fix sparse warnings
Deleted some unused code that could do bad things on non-x86 platforms.
Also fixed some minor formatting errors.
Thanks to Al Viro for pointing out the sparse errors.
Cc: Tony Olech <tony.olech@elandigitalsystems.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/misc/ftdi-elan.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c index 0eb26a2..37d1f4e 100644 --- a/drivers/usb/misc/ftdi-elan.c +++ b/drivers/usb/misc/ftdi-elan.c @@ -1186,11 +1186,8 @@ static ssize_t ftdi_elan_write(struct file *file, int retval = 0; struct urb *urb; char *buf; - char data[30 *3 + 4]; - char *d = data; - const char __user *s = user_buffer; - int m = (sizeof(data) - 1) / 3; - struct usb_ftdi *ftdi = (struct usb_ftdi *)file->private_data; + struct usb_ftdi *ftdi = file->private_data; + if (ftdi->disconnected > 0) { return -ENODEV; } @@ -1220,27 +1217,18 @@ static ssize_t ftdi_elan_write(struct file *file, if (retval) { dev_err(&ftdi->udev->dev, "failed submitting write urb, error %" "d\n", retval); - goto error_4; + goto error_3; } usb_free_urb(urb); - exit:; - if (count > m) { - int I = m - 1; - while (I-- > 0) { - d += sprintf(d, " %02X", 0x000000FF & *s++); - } - d += sprintf(d, " .."); - } else { - int I = count; - while (I-- > 0) { - d += sprintf(d, " %02X", 0x000000FF & *s++); - } - } + +exit: return count; - error_4: error_3:usb_buffer_free(ftdi->udev, count, buf, - urb->transfer_dma); - error_2:usb_free_urb(urb); - error_1:return retval; +error_3: + usb_buffer_free(ftdi->udev, count, buf, urb->transfer_dma); +error_2: + usb_free_urb(urb); +error_1: + return retval; } static struct file_operations ftdi_elan_fops = { |