Commit 96a51892 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 516077c1
......@@ -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 = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment