Commit 880d29f1 authored by Jiri Slaby's avatar Jiri Slaby Committed by Jiri Kosina

HID: indent switches/cases

Bring switch and cases into coding style and save thus some
indentation to make the code tighter.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 02ae9a1a
This diff is collapsed.
This diff is collapsed.
...@@ -197,31 +197,31 @@ static void hid_irq_in(struct urb *urb) ...@@ -197,31 +197,31 @@ static void hid_irq_in(struct urb *urb)
int status; int status;
switch (urb->status) { switch (urb->status) {
case 0: /* success */ case 0: /* success */
usbhid->retry_delay = 0; usbhid->retry_delay = 0;
hid_input_report(urb->context, HID_INPUT_REPORT, hid_input_report(urb->context, HID_INPUT_REPORT,
urb->transfer_buffer, urb->transfer_buffer,
urb->actual_length, 1); urb->actual_length, 1);
break; break;
case -EPIPE: /* stall */ case -EPIPE: /* stall */
clear_bit(HID_IN_RUNNING, &usbhid->iofl); clear_bit(HID_IN_RUNNING, &usbhid->iofl);
set_bit(HID_CLEAR_HALT, &usbhid->iofl); set_bit(HID_CLEAR_HALT, &usbhid->iofl);
schedule_work(&usbhid->reset_work); schedule_work(&usbhid->reset_work);
return; return;
case -ECONNRESET: /* unlink */ case -ECONNRESET: /* unlink */
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: /* unplug */ case -ESHUTDOWN: /* unplug */
clear_bit(HID_IN_RUNNING, &usbhid->iofl); clear_bit(HID_IN_RUNNING, &usbhid->iofl);
return; return;
case -EILSEQ: /* protocol error or unplug */ case -EILSEQ: /* protocol error or unplug */
case -EPROTO: /* protocol error or unplug */ case -EPROTO: /* protocol error or unplug */
case -ETIME: /* protocol error or unplug */ case -ETIME: /* protocol error or unplug */
case -ETIMEDOUT: /* Should never happen, but... */ case -ETIMEDOUT: /* Should never happen, but... */
clear_bit(HID_IN_RUNNING, &usbhid->iofl); clear_bit(HID_IN_RUNNING, &usbhid->iofl);
hid_io_error(hid); hid_io_error(hid);
return; return;
default: /* error */ default: /* error */
warn("input irq status %d received", urb->status); warn("input irq status %d received", urb->status);
} }
status = usb_submit_urb(urb, GFP_ATOMIC); status = usb_submit_urb(urb, GFP_ATOMIC);
...@@ -319,17 +319,17 @@ static void hid_irq_out(struct urb *urb) ...@@ -319,17 +319,17 @@ static void hid_irq_out(struct urb *urb)
int unplug = 0; int unplug = 0;
switch (urb->status) { switch (urb->status) {
case 0: /* success */ case 0: /* success */
break; break;
case -ESHUTDOWN: /* unplug */ case -ESHUTDOWN: /* unplug */
unplug = 1; unplug = 1;
case -EILSEQ: /* protocol error or unplug */ case -EILSEQ: /* protocol error or unplug */
case -EPROTO: /* protocol error or unplug */ case -EPROTO: /* protocol error or unplug */
case -ECONNRESET: /* unlink */ case -ECONNRESET: /* unlink */
case -ENOENT: case -ENOENT:
break; break;
default: /* error */ default: /* error */
warn("output irq status %d received", urb->status); warn("output irq status %d received", urb->status);
} }
spin_lock_irqsave(&usbhid->outlock, flags); spin_lock_irqsave(&usbhid->outlock, flags);
...@@ -367,21 +367,22 @@ static void hid_ctrl(struct urb *urb) ...@@ -367,21 +367,22 @@ static void hid_ctrl(struct urb *urb)
spin_lock_irqsave(&usbhid->ctrllock, flags); spin_lock_irqsave(&usbhid->ctrllock, flags);
switch (urb->status) { switch (urb->status) {
case 0: /* success */ case 0: /* success */
if (usbhid->ctrl[usbhid->ctrltail].dir == USB_DIR_IN) if (usbhid->ctrl[usbhid->ctrltail].dir == USB_DIR_IN)
hid_input_report(urb->context, usbhid->ctrl[usbhid->ctrltail].report->type, hid_input_report(urb->context,
urb->transfer_buffer, urb->actual_length, 0); usbhid->ctrl[usbhid->ctrltail].report->type,
break; urb->transfer_buffer, urb->actual_length, 0);
case -ESHUTDOWN: /* unplug */ break;
unplug = 1; case -ESHUTDOWN: /* unplug */
case -EILSEQ: /* protocol error or unplug */ unplug = 1;
case -EPROTO: /* protocol error or unplug */ case -EILSEQ: /* protocol error or unplug */
case -ECONNRESET: /* unlink */ case -EPROTO: /* protocol error or unplug */
case -ENOENT: case -ECONNRESET: /* unlink */
case -EPIPE: /* report not available */ case -ENOENT:
break; case -EPIPE: /* report not available */
default: /* error */ break;
warn("ctrl urb status %d received", urb->status); default: /* error */
warn("ctrl urb status %d received", urb->status);
} }
if (unplug) if (unplug)
......
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