aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2008-06-18 17:55:41 -0400
committerJiri Kosina <jkosina@suse.cz>2008-10-14 17:50:50 -0400
commit880d29f109428be1d027adf919a7457d8fe41fd3 (patch)
tree4f413f49e8338193ba68683d03bbea603f7380ee /drivers/hid/usbhid
parent02ae9a1a8bc1d08a8fd5f6a0b8bde400b0f891b9 (diff)
HID: indent switches/cases
Bring switch and cases into coding style and save thus some indentation to make the code tighter. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid')
-rw-r--r--drivers/hid/usbhid/hid-core.c103
1 files changed, 52 insertions, 51 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 972680820730..78553b457a2b 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -197,31 +197,31 @@ static void hid_irq_in(struct urb *urb)
197 int status; 197 int status;
198 198
199 switch (urb->status) { 199 switch (urb->status) {
200 case 0: /* success */ 200 case 0: /* success */
201 usbhid->retry_delay = 0; 201 usbhid->retry_delay = 0;
202 hid_input_report(urb->context, HID_INPUT_REPORT, 202 hid_input_report(urb->context, HID_INPUT_REPORT,
203 urb->transfer_buffer, 203 urb->transfer_buffer,
204 urb->actual_length, 1); 204 urb->actual_length, 1);
205 break; 205 break;
206 case -EPIPE: /* stall */ 206 case -EPIPE: /* stall */
207 clear_bit(HID_IN_RUNNING, &usbhid->iofl); 207 clear_bit(HID_IN_RUNNING, &usbhid->iofl);
208 set_bit(HID_CLEAR_HALT, &usbhid->iofl); 208 set_bit(HID_CLEAR_HALT, &usbhid->iofl);
209 schedule_work(&usbhid->reset_work); 209 schedule_work(&usbhid->reset_work);
210 return; 210 return;
211 case -ECONNRESET: /* unlink */ 211 case -ECONNRESET: /* unlink */
212 case -ENOENT: 212 case -ENOENT:
213 case -ESHUTDOWN: /* unplug */ 213 case -ESHUTDOWN: /* unplug */
214 clear_bit(HID_IN_RUNNING, &usbhid->iofl); 214 clear_bit(HID_IN_RUNNING, &usbhid->iofl);
215 return; 215 return;
216 case -EILSEQ: /* protocol error or unplug */ 216 case -EILSEQ: /* protocol error or unplug */
217 case -EPROTO: /* protocol error or unplug */ 217 case -EPROTO: /* protocol error or unplug */
218 case -ETIME: /* protocol error or unplug */ 218 case -ETIME: /* protocol error or unplug */
219 case -ETIMEDOUT: /* Should never happen, but... */ 219 case -ETIMEDOUT: /* Should never happen, but... */
220 clear_bit(HID_IN_RUNNING, &usbhid->iofl); 220 clear_bit(HID_IN_RUNNING, &usbhid->iofl);
221 hid_io_error(hid); 221 hid_io_error(hid);
222 return; 222 return;
223 default: /* error */ 223 default: /* error */
224 warn("input irq status %d received", urb->status); 224 warn("input irq status %d received", urb->status);
225 } 225 }
226 226
227 status = usb_submit_urb(urb, GFP_ATOMIC); 227 status = usb_submit_urb(urb, GFP_ATOMIC);
@@ -319,17 +319,17 @@ static void hid_irq_out(struct urb *urb)
319 int unplug = 0; 319 int unplug = 0;
320 320
321 switch (urb->status) { 321 switch (urb->status) {
322 case 0: /* success */ 322 case 0: /* success */
323 break; 323 break;
324 case -ESHUTDOWN: /* unplug */ 324 case -ESHUTDOWN: /* unplug */
325 unplug = 1; 325 unplug = 1;
326 case -EILSEQ: /* protocol error or unplug */ 326 case -EILSEQ: /* protocol error or unplug */
327 case -EPROTO: /* protocol error or unplug */ 327 case -EPROTO: /* protocol error or unplug */
328 case -ECONNRESET: /* unlink */ 328 case -ECONNRESET: /* unlink */
329 case -ENOENT: 329 case -ENOENT:
330 break; 330 break;
331 default: /* error */ 331 default: /* error */
332 warn("output irq status %d received", urb->status); 332 warn("output irq status %d received", urb->status);
333 } 333 }
334 334
335 spin_lock_irqsave(&usbhid->outlock, flags); 335 spin_lock_irqsave(&usbhid->outlock, flags);
@@ -367,21 +367,22 @@ static void hid_ctrl(struct urb *urb)
367 spin_lock_irqsave(&usbhid->ctrllock, flags); 367 spin_lock_irqsave(&usbhid->ctrllock, flags);
368 368
369 switch (urb->status) { 369 switch (urb->status) {
370 case 0: /* success */ 370 case 0: /* success */
371 if (usbhid->ctrl[usbhid->ctrltail].dir == USB_DIR_IN) 371 if (usbhid->ctrl[usbhid->ctrltail].dir == USB_DIR_IN)
372 hid_input_report(urb->context, usbhid->ctrl[usbhid->ctrltail].report->type, 372 hid_input_report(urb->context,
373 urb->transfer_buffer, urb->actual_length, 0); 373 usbhid->ctrl[usbhid->ctrltail].report->type,
374 break; 374 urb->transfer_buffer, urb->actual_length, 0);
375 case -ESHUTDOWN: /* unplug */ 375 break;
376 unplug = 1; 376 case -ESHUTDOWN: /* unplug */
377 case -EILSEQ: /* protocol error or unplug */ 377 unplug = 1;
378 case -EPROTO: /* protocol error or unplug */ 378 case -EILSEQ: /* protocol error or unplug */
379 case -ECONNRESET: /* unlink */ 379 case -EPROTO: /* protocol error or unplug */
380 case -ENOENT: 380 case -ECONNRESET: /* unlink */
381 case -EPIPE: /* report not available */ 381 case -ENOENT:
382 break; 382 case -EPIPE: /* report not available */
383 default: /* error */ 383 break;
384 warn("ctrl urb status %d received", urb->status); 384 default: /* error */
385 warn("ctrl urb status %d received", urb->status);
385 } 386 }
386 387
387 if (unplug) 388 if (unplug)