USB: ftdi-elan: fix sparse warnings
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 9 Oct 2006 19:24:49 +0000 (12:24 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Oct 2006 21:46:31 +0000 (14:46 -0700)
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>
drivers/usb/misc/ftdi-elan.c

index 0eb26a26115ba896677e8686763e080d2bd2cfd0..37d1f4e90d5a6c261c09c604f3864be7fed1a8c0 100644 (file)
@@ -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 = {