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, ...@@ -1186,11 +1186,8 @@ static ssize_t ftdi_elan_write(struct file *file,
int retval = 0; int retval = 0;
struct urb *urb; struct urb *urb;
char *buf; char *buf;
char data[30 *3 + 4]; struct usb_ftdi *ftdi = file->private_data;
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;
if (ftdi->disconnected > 0) { if (ftdi->disconnected > 0) {
return -ENODEV; return -ENODEV;
} }
...@@ -1220,27 +1217,18 @@ static ssize_t ftdi_elan_write(struct file *file, ...@@ -1220,27 +1217,18 @@ static ssize_t ftdi_elan_write(struct file *file,
if (retval) { if (retval) {
dev_err(&ftdi->udev->dev, "failed submitting write urb, error %" dev_err(&ftdi->udev->dev, "failed submitting write urb, error %"
"d\n", retval); "d\n", retval);
goto error_4; goto error_3;
} }
usb_free_urb(urb); usb_free_urb(urb);
exit:;
if (count > m) { exit:
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++);
}
}
return count; return count;
error_4: error_3:usb_buffer_free(ftdi->udev, count, buf, error_3:
urb->transfer_dma); usb_buffer_free(ftdi->udev, count, buf, urb->transfer_dma);
error_2:usb_free_urb(urb); error_2:
error_1:return retval; usb_free_urb(urb);
error_1:
return retval;
} }
static struct file_operations ftdi_elan_fops = { 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