[PATCH] staging: android: sync.c: Changed the ways nullptrs were being checked
Removed all checkpatch.pl CHECKs that suggested to check NULL by !obj instead of obj == NULL. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/android/sync.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index f83e00c..5413f28 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -43,7 +43,7 @@ struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops, return NULL; obj = kzalloc(size, GFP_KERNEL); - if (obj == NULL) + if (!obj) return NULL; kref_init(>kref); @@ -130,7 +130,7 @@ struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size) return NULL; pt = kzalloc(size, GFP_KERNEL); - if (pt == NULL) + if (!pt) return NULL; spin_lock_irqsave(>child_list_lock, flags); @@ -155,7 +155,7 @@ static struct sync_fence *sync_fence_alloc(int size, const char *name) struct sync_fence *fence; fence = kzalloc(size, GFP_KERNEL); - if (fence == NULL) + if (!fence) return NULL; fence->file = anon_inode_getfile("sync_fence", _fence_fops, @@ -193,7 +193,7 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) struct sync_fence *fence; fence = sync_fence_alloc(offsetof(struct sync_fence, cbs[1]), name); - if (fence == NULL) + if (!fence) return NULL; fence->num_fences = 1; @@ -215,7 +215,7 @@ struct sync_fence *sync_fence_fdget(int fd) { struct file *file = fget(fd); - if (file == NULL) + if (!file) return NULL; if (file->f_op != _fence_fops) @@ -262,7 +262,7 @@ struct sync_fence *sync_fence_merge(const char *name, unsigned long size = offsetof(struct sync_fence, cbs[num_fences]); fence = sync_fence_alloc(size, name); - if (fence == NULL) + if (!fence) return NULL; atomic_set(>status, num_fences); @@ -583,14 +583,14 @@ static long sync_fence_ioctl_merge(struct sync_fence *fence, unsigned long arg) } fence2 = sync_fence_fdget(data.fd2); - if (fence2 == NULL) { + if (!fence2) { err = -ENOENT; goto err_put_fd; } data.name[sizeof(data.name) - 1] = '\0'; fence3 = sync_fence_merge(data.name, fence, fence2); - if (fence3 == NULL) { + if (!fence3) { err = -ENOMEM; goto err_put_fence2; } @@ -666,7 +666,7 @@ static long sync_fence_ioctl_fence_info(struct sync_fence *fence, size = 4096; data = kzalloc(size, GFP_KERNEL); - if (data == NULL) + if (!data) return -ENOMEM; strlcpy(data->name, fence->name, sizeof(data->name)); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: core: devio.c: Removed unnecessary space
Removed an unnecessary space between a function name and arguments. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/usb/core/devio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 38ae877c..0bcd45e 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1910,7 +1910,7 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg) ret = releaseintf(ps, ifnum); if (ret < 0) return ret; - destroy_async_on_interface (ps, ifnum); + destroy_async_on_interface(ps, ifnum); return 0; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] staging: android: sync.c: Changed the ways nullptrs were being checked
Removed all checkpatch.pl CHECKs that suggested to check NULL by !obj instead of obj == NULL. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/android/sync.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index f83e00c..5413f28 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -43,7 +43,7 @@ struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops, return NULL; obj = kzalloc(size, GFP_KERNEL); - if (obj == NULL) + if (!obj) return NULL; kref_init(>kref); @@ -130,7 +130,7 @@ struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size) return NULL; pt = kzalloc(size, GFP_KERNEL); - if (pt == NULL) + if (!pt) return NULL; spin_lock_irqsave(>child_list_lock, flags); @@ -155,7 +155,7 @@ static struct sync_fence *sync_fence_alloc(int size, const char *name) struct sync_fence *fence; fence = kzalloc(size, GFP_KERNEL); - if (fence == NULL) + if (!fence) return NULL; fence->file = anon_inode_getfile("sync_fence", _fence_fops, @@ -193,7 +193,7 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) struct sync_fence *fence; fence = sync_fence_alloc(offsetof(struct sync_fence, cbs[1]), name); - if (fence == NULL) + if (!fence) return NULL; fence->num_fences = 1; @@ -215,7 +215,7 @@ struct sync_fence *sync_fence_fdget(int fd) { struct file *file = fget(fd); - if (file == NULL) + if (!file) return NULL; if (file->f_op != _fence_fops) @@ -262,7 +262,7 @@ struct sync_fence *sync_fence_merge(const char *name, unsigned long size = offsetof(struct sync_fence, cbs[num_fences]); fence = sync_fence_alloc(size, name); - if (fence == NULL) + if (!fence) return NULL; atomic_set(>status, num_fences); @@ -583,14 +583,14 @@ static long sync_fence_ioctl_merge(struct sync_fence *fence, unsigned long arg) } fence2 = sync_fence_fdget(data.fd2); - if (fence2 == NULL) { + if (!fence2) { err = -ENOENT; goto err_put_fd; } data.name[sizeof(data.name) - 1] = '\0'; fence3 = sync_fence_merge(data.name, fence, fence2); - if (fence3 == NULL) { + if (!fence3) { err = -ENOMEM; goto err_put_fence2; } @@ -666,7 +666,7 @@ static long sync_fence_ioctl_fence_info(struct sync_fence *fence, size = 4096; data = kzalloc(size, GFP_KERNEL); - if (data == NULL) + if (!data) return -ENOMEM; strlcpy(data->name, fence->name, sizeof(data->name)); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: core: devio.c: Removed unnecessary space
Removed an unnecessary space between a function name and arguments. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/usb/core/devio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 38ae877c..0bcd45e 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1910,7 +1910,7 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg) ret = releaseintf(ps, ifnum); if (ret < 0) return ret; - destroy_async_on_interface (ps, ifnum); + destroy_async_on_interface(ps, ifnum); return 0; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: core: hub: Removed some warnings generated by checkpatch.pl
Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hub.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 431839b..169e3d8 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4222,7 +4222,7 @@ static int hub_enable_device(struct usb_device *udev) * but it is still necessary to lock the port. */ static int -hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, +hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, int retry_counter) { struct usb_device *hdev = hub-hdev; @@ -4526,7 +4526,7 @@ fail: } static void -check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) +check_highspeed(struct usb_hub *hub, struct usb_device *udev, int port1) { struct usb_qualifier_descriptor *qual; int status; @@ -4534,11 +4534,11 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) if (udev-quirks USB_QUIRK_DEVICE_QUALIFIER) return; - qual = kmalloc (sizeof *qual, GFP_KERNEL); + qual = kmalloc(sizeof *qual, GFP_KERNEL); if (qual == NULL) return; - status = usb_get_descriptor (udev, USB_DT_DEVICE_QUALIFIER, 0, + status = usb_get_descriptor(udev, USB_DT_DEVICE_QUALIFIER, 0, qual, sizeof *qual); if (status == sizeof *qual) { dev_info(udev-dev, not running at top speed; @@ -4554,7 +4554,7 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) } static unsigned -hub_power_remaining (struct usb_hub *hub) +hub_power_remaining(struct usb_hub *hub) { struct usb_device *hdev = hub-hdev; int remaining; @@ -4741,7 +4741,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, if (le16_to_cpu(udev-descriptor.bcdUSB) = 0x0200 udev-speed == USB_SPEED_FULL highspeed_hubs != 0) - check_highspeed (hub, udev, port1); + check_highspeed(hub, udev, port1); /* Store the parent's children[] pointer. At this point * udev becomes globally accessible, although presumably @@ -5115,7 +5115,7 @@ static const struct usb_device_id hub_id_table[] = { { }/* Terminating entry */ }; -MODULE_DEVICE_TABLE (usb, hub_id_table); +MODULE_DEVICE_TABLE(usb, hub_id_table); static struct usb_driver hub_driver = { .name = hub, @@ -5227,7 +5227,7 @@ static int descriptors_changed(struct usb_device *udev, changed = 1; break; } - if (memcmp (buf, udev-rawdescriptors[index], old_length) + if (memcmp(buf, udev-rawdescriptors[index], old_length) != 0) { dev_dbg(udev-dev, config index %d changed (#%d)\n, index, -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: core: hub: Removed some warnings generated by checkpatch.pl
Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hub.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 38cb6d3..b9cab51 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4218,7 +4218,7 @@ static int hub_enable_device(struct usb_device *udev) * but it is still necessary to lock the port. */ static int -hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, +hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, int retry_counter) { struct usb_device *hdev = hub-hdev; @@ -4522,7 +4522,7 @@ fail: } static void -check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) +check_highspeed(struct usb_hub *hub, struct usb_device *udev, int port1) { struct usb_qualifier_descriptor *qual; int status; @@ -4530,11 +4530,11 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) if (udev-quirks USB_QUIRK_DEVICE_QUALIFIER) return; - qual = kmalloc (sizeof *qual, GFP_KERNEL); + qual = kmalloc(sizeof *qual, GFP_KERNEL); if (qual == NULL) return; - status = usb_get_descriptor (udev, USB_DT_DEVICE_QUALIFIER, 0, + status = usb_get_descriptor udev, USB_DT_DEVICE_QUALIFIER, 0, qual, sizeof *qual); if (status == sizeof *qual) { dev_info(udev-dev, not running at top speed; @@ -4550,7 +4550,7 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) } static unsigned -hub_power_remaining (struct usb_hub *hub) +hub_power_remaining(struct usb_hub *hub) { struct usb_device *hdev = hub-hdev; int remaining; @@ -4737,7 +4737,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, if (le16_to_cpu(udev-descriptor.bcdUSB) = 0x0200 udev-speed == USB_SPEED_FULL highspeed_hubs != 0) - check_highspeed (hub, udev, port1); + check_highspeed(hub, udev, port1); /* Store the parent's children[] pointer. At this point * udev becomes globally accessible, although presumably @@ -5111,7 +5111,7 @@ static const struct usb_device_id hub_id_table[] = { { }/* Terminating entry */ }; -MODULE_DEVICE_TABLE (usb, hub_id_table); +MODULE_DEVICE_TABLE(usb, hub_id_table); static struct usb_driver hub_driver = { .name = hub, @@ -5223,7 +5223,7 @@ static int descriptors_changed(struct usb_device *udev, changed = 1; break; } - if (memcmp (buf, udev-rawdescriptors[index], old_length) + if (memcmp(buf, udev-rawdescriptors[index], old_length) != 0) { dev_dbg(udev-dev, config index %d changed (#%d)\n, index, -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: core: hub: Removed some warnings generated by checkpatch.pl
Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hub.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 9387cc20..38cb6d3 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1442,8 +1442,8 @@ static int hub_configure(struct usb_hub *hub, break; } - spin_lock_init (hub-tt.lock); - INIT_LIST_HEAD (hub-tt.clear_list); + spin_lock_init(hub-tt.lock); + INIT_LIST_HEAD(hub-tt.clear_list); INIT_WORK(hub-tt.clear_work, hub_tt_work); switch (hdev-descriptor.bDeviceProtocol) { case USB_HUB_PR_FS: @@ -1632,7 +1632,7 @@ static int hub_configure(struct usb_hub *hub, return 0; fail: - dev_err (hub_dev, config failed, %s (err %d)\n, + dev_err(hub_dev, config failed, %s (err %d)\n, message, ret); /* hub_disconnect() frees urb and descriptor */ return ret; @@ -1775,7 +1775,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) if ((desc-desc.bInterfaceSubClass != 0) (desc-desc.bInterfaceSubClass != 1)) { descriptor_error: - dev_err (intf-dev, bad descriptor, ignoring hub\n); + dev_err(intf-dev, bad descriptor, ignoring hub\n); return -EIO; } @@ -1790,11 +1790,11 @@ descriptor_error: goto descriptor_error; /* We found a hub */ - dev_info (intf-dev, USB hub found\n); + dev_info(intf-dev, USB hub found\n); hub = kzalloc(sizeof(*hub), GFP_KERNEL); if (!hub) { - dev_dbg (intf-dev, couldn't kmalloc hub struct\n); + dev_dbg(intf-dev, couldn't kmalloc hub struct\n); return -ENOMEM; } @@ -1807,7 +1807,7 @@ descriptor_error: usb_get_intf(intf); usb_get_dev(hdev); - usb_set_intfdata (intf, hub); + usb_set_intfdata(intf, hub); intf-needs_remote_wakeup = 1; pm_suspend_ignore_children(intf-dev, true); @@ -1820,14 +1820,14 @@ descriptor_error: if (hub_configure(hub, endpoint) = 0) return 0; - hub_disconnect (intf); + hub_disconnect(intf); return -ENODEV; } static int hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data) { - struct usb_device *hdev = interface_to_usbdev (intf); + struct usb_device *hdev = interface_to_usbdev(intf); struct usb_hub *hub = usb_hub_to_struct_hub(hdev); /* assert ifno == 0 (part of hub spec) */ @@ -2143,7 +2143,7 @@ void usb_disconnect(struct usb_device **pdev) * cleaning up all state associated with the current configuration * so that the hardware is now fully quiesced. */ - dev_dbg (udev-dev, unregistering device\n); + dev_dbg(udev-dev, unregistering device\n); usb_disable_device(udev, 0); usb_hcd_synchronize_unlinks(udev); @@ -2242,7 +2242,7 @@ static int usb_enumerate_device_otg(struct usb_device *udev) struct usb_bus *bus = udev-bus; /* descriptor may appear anywhere in config */ - if (__usb_get_extra_descriptor (udev-rawdescriptors[0], + if (__usb_get_extra_descriptor(udev-rawdescriptors[0], le16_to_cpu(udev-config[0].desc.wTotalLength), USB_DT_OTG, (void **) desc) == 0) { if (desc-bmAttributes USB_OTG_HNP) { @@ -3526,7 +3526,7 @@ static int check_ports_changed(struct usb_hub *hub) static int hub_suspend(struct usb_interface *intf, pm_message_t msg) { - struct usb_hub *hub = usb_get_intfdata (intf); + struct usb_hub *hub = usb_get_intfdata(intf); struct usb_device *hdev = hub-hdev; unsignedport1; int status; -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: core: hub.c: Removed some warnings generated by checkpatch.pl
Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hub.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 73dfa19..9387cc20 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -50,8 +50,8 @@ DEFINE_MUTEX(usb_port_peer_mutex); /* cycle leds on hubs that aren't blinking for attention */ static bool blinkenlights = 0; -module_param (blinkenlights, bool, S_IRUGO); -MODULE_PARM_DESC (blinkenlights, true to cycle leds on hubs); +module_param(blinkenlights, bool, S_IRUGO); +MODULE_PARM_DESC(blinkenlights, true to cycle leds on hubs); /* * Device SATA8000 FW1.0 from DATAST0R Technology Corp requires about @@ -439,7 +439,7 @@ static void set_port_led(struct usb_hub *hub, int port1, int selector) #defineLED_CYCLE_PERIOD((2*HZ)/3) -static void led_work (struct work_struct *work) +static void led_work(struct work_struct *work) { struct usb_hub *hub = container_of(work, struct usb_hub, leds.work); @@ -646,7 +646,7 @@ static void hub_irq(struct urb *urb) default:/* presumably an error */ /* Cause a hub reset after 10 consecutive errors */ - dev_dbg (hub-intfdev, transfer -- %d\n, status); + dev_dbg(hub-intfdev, transfer -- %d\n, status); if ((++hub-nerrors 10) || hub-error) goto resubmit; hub-error = status; @@ -671,14 +671,14 @@ resubmit: if (hub-quiescing) return; - if ((status = usb_submit_urb (hub-urb, GFP_ATOMIC)) != 0 + if ((status = usb_submit_urb(hub-urb, GFP_ATOMIC)) != 0 status != -ENODEV status != -EPERM) - dev_err (hub-intfdev, resubmit -- %d\n, status); + dev_err(hub-intfdev, resubmit -- %d\n, status); } /* USB 2.0 spec Section 11.24.2.3 */ static inline int -hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) +hub_clear_tt_buffer(struct usb_device *hdev, u16 devinfo, u16 tt) { /* Need to clear both directions for control ep */ if (((devinfo 11) USB_ENDPOINT_XFERTYPE_MASK) == @@ -706,7 +706,7 @@ static void hub_tt_work(struct work_struct *work) container_of(work, struct usb_hub, tt.clear_work); unsigned long flags; - spin_lock_irqsave (hub-tt.lock, flags); + spin_lock_irqsave(hub-tt.lock, flags); while (!list_empty(hub-tt.clear_list)) { struct list_head*next; struct usb_tt_clear *clear; @@ -715,14 +715,14 @@ static void hub_tt_work(struct work_struct *work) int status; next = hub-tt.clear_list.next; - clear = list_entry (next, struct usb_tt_clear, clear_list); - list_del (clear-clear_list); + clear = list_entry(next, struct usb_tt_clear, clear_list); + list_del(clear-clear_list); /* drop lock so HCD can concurrently report other TT errors */ - spin_unlock_irqrestore (hub-tt.lock, flags); - status = hub_clear_tt_buffer (hdev, clear-devinfo, clear-tt); + spin_unlock_irqrestore(hub-tt.lock, flags); + status = hub_clear_tt_buffer(hdev, clear-devinfo, clear-tt); if (status status != -ENODEV) - dev_err (hdev-dev, + dev_err(hdev-dev, clear tt %d (%04x) error %d\n, clear-tt, clear-devinfo, status); @@ -734,7 +734,7 @@ static void hub_tt_work(struct work_struct *work) kfree(clear); spin_lock_irqsave(hub-tt.lock, flags); } - spin_unlock_irqrestore (hub-tt.lock, flags); + spin_unlock_irqrestore(hub-tt.lock, flags); } /** @@ -797,7 +797,7 @@ int usb_hub_clear_tt_buffer(struct urb *urb) */ clear = kmalloc(sizeof *clear, GFP_ATOMIC); if (clear == NULL) { - dev_err (udev-dev, can't save CLEAR_TT_BUFFER state\n); + dev_err(udev-dev, can't save CLEAR_TT_BUFFER state\n); /* FIXME recover somehow ... RESET_TT? */ return -ENOMEM; } @@ -806,10 +806,10 @@ int usb_hub_clear_tt_buffer(struct urb *urb) clear-tt = tt-multi ? udev-ttport : 1; clear-devinfo = usb_pipeendpoint (pipe); clear-devinfo |= udev-devnum 4; - clear-devinfo |= usb_pipecontrol (pipe) + clear-devinfo |= usb_pipecontrol(pipe) ? (USB_ENDPOINT_XFER_CONTROL 11) : (USB_ENDPOINT_XFER_BULK 11); - if (usb_pipein (pipe)) + if (usb_pipein
[PATCH] drivers/usb/core: devio.c: Removed various errors and warnings generated by checkpatch.pl
Fixed several errors and warnings. Lines 29, 103, 1319, 1906 and 2408: removed unnecessary spaces or added appropriate spaces. Lines 1040 and 1591: changed dev_printk(KERN_DEBUG, ...) to dev_dbg(...). Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/devio.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 1163553..62c0be6 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -29,7 +29,7 @@ *22.12.1999 0.1 Initial release (split from proc_usb.c) *04.01.2000 0.2 Turned into its own filesystem *30.09.2005 0.3 Fix user-triggerable oops in async URB delivery - * (CAN-2005-3055) + * (CAN-2005-3055) */ /*/ @@ -103,7 +103,7 @@ MODULE_PARM_DESC(usbfs_snoop, true to log all usbfs traffic); #define snoop(dev, format, arg...) \ do {\ if (usbfs_snoop)\ - dev_info(dev , format , ## arg);\ + dev_info(dev, format, ## arg); \ } while (0) enum snoop_when { @@ -1040,7 +1040,7 @@ static int proc_control(struct usb_dev_state *ps, void __user *arg) snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE, NULL, 0); } if (i 0 i != -EPIPE) { - dev_printk(KERN_DEBUG, dev-dev, usbfs: USBDEVFS_CONTROL + dev_dbg(dev-dev, usbfs: USBDEVFS_CONTROL failed cmd %s rqt %u rq %u len %u ret %d\n, current-comm, ctrl.bRequestType, ctrl.bRequest, ctrl.wLength, i); @@ -1319,7 +1319,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb is_in = (uurb-endpoint USB_ENDPOINT_DIR_MASK) != 0; u = 0; - switch(uurb-type) { + switch (uurb-type) { case USBDEVFS_URB_TYPE_CONTROL: if (!usb_endpoint_xfer_control(ep-desc)) return -EINVAL; @@ -1591,8 +1591,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb } if (ret) { - dev_printk(KERN_DEBUG, ps-dev-dev, - usbfs: usb_submit_urb returned %d\n, ret); + dev_dbg(ps-dev-dev, usbfs: usb_submit_urb returned %d\n, ret); snoop_urb(ps-dev, as-userurb, as-urb-pipe, 0, ret, COMPLETE, NULL, 0); async_removepending(as); @@ -1906,7 +1905,7 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg) return -EFAULT; if ((ret = releaseintf(ps, ifnum)) 0) return ret; - destroy_async_on_interface (ps, ifnum); + destroy_async_on_interface(ps, ifnum); return 0; } @@ -2408,7 +2407,7 @@ static int usbdev_notify(struct notifier_block *self, } static struct notifier_block usbdev_nb = { - .notifier_call =usbdev_notify, + .notifier_call =usbdev_notify, }; static struct cdev usb_device_cdev; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] drivers/usb/core: sysfs.c: Removed a couple warnings
Removed a warnings(from checkpatch.pl) about sizeof not having parenthesis'. added parenthesis' around the strings being used. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index d269738..bb8aff1 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -428,11 +428,11 @@ static ssize_t level_store(struct device *dev, struct device_attribute *attr, usb_lock_device(udev); - if (len == sizeof on_string - 1 + if (len == sizeof(on_string) - 1 strncmp(buf, on_string, len) == 0) usb_disable_autosuspend(udev); - else if (len == sizeof auto_string - 1 + else if (len == sizeof(auto_string) - 1 strncmp(buf, auto_string, len) == 0) usb_enable_autosuspend(udev); -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] drivers/usb/core: hub.c: Removed all warnings about a space between a function name and parenthesis'
Removed 41 warnings all about a space between a function and the parenthesis' during a function call. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hub.c | 82 +- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d7c3d5a..7ac2f82 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -50,8 +50,8 @@ DEFINE_MUTEX(usb_port_peer_mutex); /* cycle leds on hubs that aren't blinking for attention */ static bool blinkenlights = 0; -module_param (blinkenlights, bool, S_IRUGO); -MODULE_PARM_DESC (blinkenlights, true to cycle leds on hubs); +module_param(blinkenlights, bool, S_IRUGO); +MODULE_PARM_DESC(blinkenlights, true to cycle leds on hubs); /* * Device SATA8000 FW1.0 from DATAST0R Technology Corp requires about @@ -439,7 +439,7 @@ static void set_port_led(struct usb_hub *hub, int port1, int selector) #defineLED_CYCLE_PERIOD((2*HZ)/3) -static void led_work (struct work_struct *work) +static void led_work(struct work_struct *work) { struct usb_hub *hub = container_of(work, struct usb_hub, leds.work); @@ -646,7 +646,7 @@ static void hub_irq(struct urb *urb) default:/* presumably an error */ /* Cause a hub reset after 10 consecutive errors */ - dev_dbg (hub-intfdev, transfer -- %d\n, status); + dev_dbg(hub-intfdev, transfer -- %d\n, status); if ((++hub-nerrors 10) || hub-error) goto resubmit; hub-error = status; @@ -671,14 +671,14 @@ resubmit: if (hub-quiescing) return; - if ((status = usb_submit_urb (hub-urb, GFP_ATOMIC)) != 0 + if ((status = usb_submit_urb(hub-urb, GFP_ATOMIC)) != 0 status != -ENODEV status != -EPERM) - dev_err (hub-intfdev, resubmit -- %d\n, status); + dev_err(hub-intfdev, resubmit -- %d\n, status); } /* USB 2.0 spec Section 11.24.2.3 */ static inline int -hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) +hub_clear_tt_buffer(struct usb_device *hdev, u16 devinfo, u16 tt) { /* Need to clear both directions for control ep */ if (((devinfo 11) USB_ENDPOINT_XFERTYPE_MASK) == @@ -706,7 +706,7 @@ static void hub_tt_work(struct work_struct *work) container_of(work, struct usb_hub, tt.clear_work); unsigned long flags; - spin_lock_irqsave (hub-tt.lock, flags); + spin_lock_irqsave(hub-tt.lock, flags); while (!list_empty(hub-tt.clear_list)) { struct list_head*next; struct usb_tt_clear *clear; @@ -715,14 +715,14 @@ static void hub_tt_work(struct work_struct *work) int status; next = hub-tt.clear_list.next; - clear = list_entry (next, struct usb_tt_clear, clear_list); - list_del (clear-clear_list); + clear = list_entry(next, struct usb_tt_clear, clear_list); + list_del(clear-clear_list); /* drop lock so HCD can concurrently report other TT errors */ - spin_unlock_irqrestore (hub-tt.lock, flags); - status = hub_clear_tt_buffer (hdev, clear-devinfo, clear-tt); + spin_unlock_irqrestore(hub-tt.lock, flags); + status = hub_clear_tt_buffer(hdev, clear-devinfo, clear-tt); if (status status != -ENODEV) - dev_err (hdev-dev, + dev_err(hdev-dev, clear tt %d (%04x) error %d\n, clear-tt, clear-devinfo, status); @@ -734,7 +734,7 @@ static void hub_tt_work(struct work_struct *work) kfree(clear); spin_lock_irqsave(hub-tt.lock, flags); } - spin_unlock_irqrestore (hub-tt.lock, flags); + spin_unlock_irqrestore(hub-tt.lock, flags); } /** @@ -795,8 +795,8 @@ int usb_hub_clear_tt_buffer(struct urb *urb) * since each TT has at least two buffers that can need it (and * there can be many TTs per hub). even if they're uncommon. */ - if ((clear = kmalloc (sizeof *clear, GFP_ATOMIC)) == NULL) { - dev_err (udev-dev, can't save CLEAR_TT_BUFFER state\n); + if ((clear = kmalloc(sizeof *clear, GFP_ATOMIC)) == NULL) { + dev_err(udev-dev, can't save CLEAR_TT_BUFFER state\n); /* FIXME recover somehow ... RESET_TT? */ return -ENOMEM; } @@ -805,10 +805,10 @@ int usb_hub_clear_tt_buffer(struct urb *urb) clear-tt = tt-multi ? udev-ttport : 1; clear-devinfo = usb_pipeendpoint (pipe); clear-devinfo |= udev-devnum 4; - clear-devinfo |= usb_pipecontrol (pipe) + clear-devinfo
[PATCH] drivers/usb/core: hcd.c: Removed all space warnings from checkpatch.pl
Removed all(except false positives, from calculations) space prohibited warnings generated by checkpatch.pl. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hcd.c | 168 - 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 45a915c..557f2b8 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -90,8 +90,8 @@ unsigned long usb_hcds_loaded; EXPORT_SYMBOL_GPL(usb_hcds_loaded); /* host controllers we manage */ -LIST_HEAD (usb_bus_list); -EXPORT_SYMBOL_GPL (usb_bus_list); +LIST_HEAD(usb_bus_list); +EXPORT_SYMBOL_GPL(usb_bus_list); /* used when allocating bus numbers */ #define USB_MAXBUS 64 @@ -99,7 +99,7 @@ static DECLARE_BITMAP(busmap, USB_MAXBUS); /* used when updating list of hcds */ DEFINE_MUTEX(usb_bus_list_lock); /* exported only for usbfs */ -EXPORT_SYMBOL_GPL (usb_bus_list_lock); +EXPORT_SYMBOL_GPL(usb_bus_list_lock); /* used for controlling access to virtual root hubs */ static DEFINE_SPINLOCK(hcd_root_hub_lock); @@ -447,7 +447,7 @@ rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len) break; case 3: /* Manufacturer */ - snprintf (buf, sizeof buf, %s %s %s, init_utsname()-sysname, + snprintf(buf, sizeof buf, %s %s %s, init_utsname()-sysname, init_utsname()-release, hcd-driver-description); s = buf; break; @@ -461,7 +461,7 @@ rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len) /* Root hub control transfers execute synchronously */ -static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) +static int rh_call_control(struct usb_hcd *hcd, struct urb *urb) { struct usb_ctrlrequest *cmd; u16 typeReq, wValue, wIndex, wLength; @@ -485,9 +485,9 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) cmd = (struct usb_ctrlrequest *) urb-setup_packet; typeReq = (cmd-bRequestType 8) | cmd-bRequest; - wValue = le16_to_cpu (cmd-wValue); - wIndex = le16_to_cpu (cmd-wIndex); - wLength = le16_to_cpu (cmd-wLength); + wValue = le16_to_cpu(cmd-wValue); + wIndex = le16_to_cpu(cmd-wIndex); + wLength = le16_to_cpu(cmd-wLength); if (wLength urb-transfer_buffer_length) goto error; @@ -616,7 +616,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) break; case DeviceOutRequest | USB_REQ_SET_ADDRESS: /* wValue == urb-dev-devaddr */ - dev_dbg (hcd-self.controller, root hub device address %d\n, + dev_dbg(hcd-self.controller, root hub device address %d\n, wValue); break; @@ -632,7 +632,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) /* FALLTHROUGH */ case EndpointOutRequest | USB_REQ_CLEAR_FEATURE: case EndpointOutRequest | USB_REQ_SET_FEATURE: - dev_dbg (hcd-self.controller, no endpoint features yet\n); + dev_dbg(hcd-self.controller, no endpoint features yet\n); break; /* CLASS REQUESTS (and errors) */ @@ -646,13 +646,13 @@ nongeneric: len = 4; break; case GetHubDescriptor: - len = sizeof (struct usb_hub_descriptor); + len = sizeof(struct usb_hub_descriptor); break; case DeviceRequest | USB_REQ_GET_DESCRIPTOR: /* len is returned by hub_control */ break; } - status = hcd-driver-hub_control (hcd, + status = hcd-driver-hub_control(hcd, typeReq, wValue, wIndex, tbuf, wLength); @@ -668,7 +668,7 @@ error: if (status 0) { len = 0; if (status != -EPIPE) { - dev_dbg (hcd-self.controller, + dev_dbg(hcd-self.controller, CTRL: TypeReq=0x%x val=0x%x idx=0x%x len=%d == %d\n, typeReq, wValue, wIndex, @@ -684,11 +684,11 @@ error: len = urb-transfer_buffer_length; urb-actual_length = len; /* always USB_DIR_IN, toward host */ - memcpy (ubuf, bufp, len); + memcpy(ubuf, bufp, len); /* report whether RH hardware supports remote wakeup */ if (patch_wakeup - len offsetof (struct usb_config_descriptor, + len offsetof(struct usb_config_descriptor
[PATCH] drivers/usb/core: hcd.c: Added parenthesis' to sizeof
Removed all warnings generated by checkpatch.pl about sizeof not having parenthesis'. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hcd.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 557f2b8..601476c7 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -447,7 +447,7 @@ rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len) break; case 3: /* Manufacturer */ - snprintf(buf, sizeof buf, %s %s %s, init_utsname()-sysname, + snprintf(buf, sizeof(buf), %s %s %s, init_utsname()-sysname, init_utsname()-release, hcd-driver-description); s = buf; break; @@ -578,16 +578,16 @@ static int rh_call_control(struct usb_hcd *hcd, struct urb *urb) switch (hcd-speed) { case HCD_USB3: bufp = ss_rh_config_descriptor; - len = sizeof ss_rh_config_descriptor; + len = sizeof(ss_rh_config_descriptor); break; case HCD_USB25: case HCD_USB2: bufp = hs_rh_config_descriptor; - len = sizeof hs_rh_config_descriptor; + len = sizeof(hs_rh_config_descriptor); break; case HCD_USB11: bufp = fs_rh_config_descriptor; - len = sizeof fs_rh_config_descriptor; + len = sizeof(fs_rh_config_descriptor); break; default: goto error; @@ -1008,7 +1008,7 @@ static int register_root_hub(struct usb_hcd *hcd) usb_dev-devnum = devnum; usb_dev-bus-devnum_next = devnum + 1; memset(usb_dev-bus-devmap.devicemap, 0, - sizeof usb_dev-bus-devmap.devicemap); + sizeof(usb_dev-bus-devmap.devicemap)); set_bit(devnum, usb_dev-bus-devmap.devicemap); usb_set_device_state(usb_dev, USB_STATE_ADDRESS); @@ -1016,7 +1016,7 @@ static int register_root_hub(struct usb_hcd *hcd) usb_dev-ep0.desc.wMaxPacketSize = cpu_to_le16(64); retval = usb_get_device_descriptor(usb_dev, USB_DT_DEVICE_SIZE); - if (retval != sizeof usb_dev-descriptor) { + if (retval != sizeof(usb_dev-descriptor)) { mutex_unlock(usb_bus_list_lock); dev_dbg(parent_dev, can't read %s device descriptor %d\n, dev_name(usb_dev-dev), retval); -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] drivers/usb/core: devio.c: Reverted previous debug print changes
Changed dev_dbg(...) back to dev_printk(KERN_DEBUG, ...) based on previous patches feedback. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/devio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 62c0be6..2734a14 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1040,7 +1040,7 @@ static int proc_control(struct usb_dev_state *ps, void __user *arg) snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE, NULL, 0); } if (i 0 i != -EPIPE) { - dev_dbg(dev-dev, usbfs: USBDEVFS_CONTROL + dev_printk(KERN_DEBUG, dev-dev, usbfs: USBDEVFS_CONTROL failed cmd %s rqt %u rq %u len %u ret %d\n, current-comm, ctrl.bRequestType, ctrl.bRequest, ctrl.wLength, i); @@ -1591,7 +1591,8 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb } if (ret) { - dev_dbg(ps-dev-dev, usbfs: usb_submit_urb returned %d\n, ret); + dev_printk(KERN_DEBUG, ps-dev-dev, + usbfs: usb_submit_urb returned %d\n, ret); snoop_urb(ps-dev, as-userurb, as-urb-pipe, 0, ret, COMPLETE, NULL, 0); async_removepending(as); -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] drivers/usb/core: hcd.c: Removed BitTime space warnings
Removed BitTime macro space warnings generated by checkpatch.pl. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hcd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 601476c7..299ff0d 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1116,18 +1116,18 @@ long usb_calc_bus_time(int speed, int is_input, int isoc, int bytecount) switch (speed) { case USB_SPEED_LOW: /* INTR only */ if (is_input) { - tmp = (67667L * (31L + 10L * BitTime (bytecount))) / 1000L; + tmp = (67667L * (31L + 10L * BitTime(bytecount))) / 1000L; return 64060L + (2 * BW_HUB_LS_SETUP) + BW_HOST_DELAY + tmp; } else { - tmp = (66700L * (31L + 10L * BitTime (bytecount))) / 1000L; + tmp = (66700L * (31L + 10L * BitTime(bytecount))) / 1000L; return 64107L + (2 * BW_HUB_LS_SETUP) + BW_HOST_DELAY + tmp; } case USB_SPEED_FULL:/* ISOC or INTR */ if (isoc) { - tmp = (8354L * (31L + 10L * BitTime (bytecount))) / 1000L; + tmp = (8354L * (31L + 10L * BitTime(bytecount))) / 1000L; return ((is_input) ? 7268L : 6265L) + BW_HOST_DELAY + tmp; } else { - tmp = (8354L * (31L + 10L * BitTime (bytecount))) / 1000L; + tmp = (8354L * (31L + 10L * BitTime(bytecount))) / 1000L; return 9107L + BW_HOST_DELAY + tmp; } case USB_SPEED_HIGH:/* ISOC or INTR */ -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] drivers/usb/core: devio.c: Removed various warnings and errors generated by checkpatch.pl
Removed warnings and erros from checkpatch.pl that go against the coding style. Lines 29 and 103: removed unwanted spaces. Lines 1040 and 1591: changed dev_printk(KERN_DEBUG, ...) to dev_dbg(dev-dev). Lines 1942: changed an else switch to else { switch (...) {...} }. (Makes more sense(to me)). Lines 1319 and 1906: added spaces to fit coding style consistently. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/devio.c | 69 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 4b0448c..1a97df0 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -29,7 +29,7 @@ *22.12.1999 0.1 Initial release (split from proc_usb.c) *04.01.2000 0.2 Turned into its own filesystem *30.09.2005 0.3 Fix user-triggerable oops in async URB delivery - * (CAN-2005-3055) + * (CAN-2005-3055) */ /*/ @@ -103,7 +103,7 @@ MODULE_PARM_DESC(usbfs_snoop, true to log all usbfs traffic); #define snoop(dev, format, arg...) \ do {\ if (usbfs_snoop)\ - dev_info(dev , format , ## arg);\ + dev_info(dev, format, ## arg); \ } while (0) enum snoop_when { @@ -1040,7 +1040,7 @@ static int proc_control(struct usb_dev_state *ps, void __user *arg) snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE, NULL, 0); } if (i 0 i != -EPIPE) { - dev_printk(KERN_DEBUG, dev-dev, usbfs: USBDEVFS_CONTROL + dev_dbg(dev-dev, usbfs: USBDEVFS_CONTROL failed cmd %s rqt %u rq %u len %u ret %d\n, current-comm, ctrl.bRequestType, ctrl.bRequest, ctrl.wLength, i); @@ -1319,7 +1319,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb is_in = (uurb-endpoint USB_ENDPOINT_DIR_MASK) != 0; u = 0; - switch(uurb-type) { + switch (uurb-type) { case USBDEVFS_URB_TYPE_CONTROL: if (!usb_endpoint_xfer_control(ep-desc)) return -EINVAL; @@ -1591,8 +1591,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb } if (ret) { - dev_printk(KERN_DEBUG, ps-dev-dev, - usbfs: usb_submit_urb returned %d\n, ret); + dev_dbg(ps-dev-dev, usbfs: usb_submit_urb returned %d\n, ret); snoop_urb(ps-dev, as-userurb, as-urb-pipe, 0, ret, COMPLETE, NULL, 0); async_removepending(as); @@ -1906,7 +1905,7 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg) return -EFAULT; if ((ret = releaseintf(ps, ifnum)) 0) return ret; - destroy_async_on_interface (ps, ifnum); + destroy_async_on_interface(ps, ifnum); return 0; } @@ -1942,36 +1941,38 @@ static int proc_ioctl(struct usb_dev_state *ps, struct usbdevfs_ioctl *ctl) retval = -EHOSTUNREACH; else if (!(intf = usb_ifnum_to_if(ps-dev, ctl-ifno))) retval = -EINVAL; - else switch (ctl-ioctl_code) { - - /* disconnect kernel driver from interface */ - case USBDEVFS_DISCONNECT: - if (intf-dev.driver) { - driver = to_usb_driver(intf-dev.driver); - dev_dbg(intf-dev, disconnect by usbfs\n); - usb_driver_release_interface(driver, intf); - } else - retval = -ENODATA; - break; + else { + switch (ctl-ioctl_code) { + + /* disconnect kernel driver from interface */ + case USBDEVFS_DISCONNECT: + if (intf-dev.driver) { + driver = to_usb_driver(intf-dev.driver); + dev_dbg(intf-dev, disconnect by usbfs\n); + usb_driver_release_interface(driver, intf); + } else + retval = -ENODATA; + break; - /* let kernel drivers try to (re)bind to the interface */ - case USBDEVFS_CONNECT: - if (!intf-dev.driver) - retval = device_attach(intf-dev); - else - retval = -EBUSY; - break; + /* let kernel drivers try to (re)bind to the interface */ + case USBDEVFS_CONNECT: + if (!intf-dev.driver