Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/usb: Remove unnecessary return's from void functions

Greg prefers this to go through the trivial tree.
http://lkml.org/lkml/2010/6/24/1

There are about 2500 void functions in drivers/usb
Only a few used return; at end of function.

Standardize them a bit.

Moved a statement down a line in drivers/usb/host/u132-hcd.c

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Joe Perches and committed by
Jiri Kosina
7f26b3a7 429d646d

+2 -99
-1
drivers/usb/gadget/at91_udc.c
··· 1266 1266 csr |= AT91_UDP_TXPKTRDY; 1267 1267 __raw_writel(csr, creg); 1268 1268 udc->req_pending = 0; 1269 - return; 1270 1269 } 1271 1270 1272 1271 static void handle_ep0(struct at91_udc *udc)
-2
drivers/usb/gadget/f_audio.c
··· 317 317 318 318 u_audio_playback(&audio->card, play_buf->buf, play_buf->actual); 319 319 f_audio_buffer_free(play_buf); 320 - 321 - return; 322 320 } 323 321 324 322 static int f_audio_out_ep_complete(struct usb_ep *ep, struct usb_request *req)
-4
drivers/usb/gadget/f_hid.c
··· 318 318 spin_unlock(&hidg->spinlock); 319 319 320 320 wake_up(&hidg->read_queue); 321 - 322 - return; 323 321 } 324 322 325 323 static int hidg_setup(struct usb_function *f, ··· 411 413 412 414 usb_ep_disable(hidg->in_ep); 413 415 hidg->in_ep->driver_data = NULL; 414 - 415 - return; 416 416 } 417 417 418 418 static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
-6
drivers/usb/gadget/fsl_udc_core.c
··· 287 287 temp = fsl_readl(&dr_regs->usbcmd); 288 288 temp |= USB_CMD_RUN_STOP; 289 289 fsl_writel(temp, &dr_regs->usbcmd); 290 - 291 - return; 292 290 } 293 291 294 292 static void dr_controller_stop(struct fsl_udc *udc) ··· 306 308 tmp = fsl_readl(&dr_regs->usbcmd); 307 309 tmp &= ~USB_CMD_RUN_STOP; 308 310 fsl_writel(tmp, &dr_regs->usbcmd); 309 - 310 - return; 311 311 } 312 312 313 313 static void dr_ep_setup(unsigned char ep_num, unsigned char dir, ··· 412 416 p_QH->max_pkt_length = cpu_to_le32(tmp); 413 417 p_QH->next_dtd_ptr = 1; 414 418 p_QH->size_ioc_int_sts = 0; 415 - 416 - return; 417 419 } 418 420 419 421 /* Setup qh structure and ep register for ep0. */
-3
drivers/usb/gadget/langwell_udc.c
··· 284 284 } 285 285 286 286 VDBG(dev, "<--- %s()\n", __func__); 287 - return; 288 287 } 289 288 290 289 ··· 1485 1486 writel(usbcmd, &dev->op_regs->usbcmd); 1486 1487 1487 1488 DBG(dev, "<--- %s()\n", __func__); 1488 - return; 1489 1489 } 1490 1490 1491 1491 ··· 1507 1509 writel(usbcmd, &dev->op_regs->usbcmd); 1508 1510 1509 1511 DBG(dev, "<--- %s()\n", __func__); 1510 - return; 1511 1512 } 1512 1513 1513 1514
-2
drivers/usb/gadget/pxa27x_udc.c
··· 1394 1394 } 1395 1395 1396 1396 spin_unlock_irqrestore(&ep->lock, flags); 1397 - 1398 - return; 1399 1397 } 1400 1398 1401 1399 /**
-2
drivers/usb/gadget/rndis.c
··· 916 916 917 917 if (configNr >= RNDIS_MAX_CONFIGS) return; 918 918 rndis_per_dev_params [configNr].used = 0; 919 - 920 - return; 921 919 } 922 920 923 921 int rndis_set_param_dev(u8 configNr, struct net_device *dev, u16 *cdc_filter)
-1
drivers/usb/host/ehci-hcd.c
··· 1041 1041 ep->hcpriv = NULL; 1042 1042 done: 1043 1043 spin_unlock_irqrestore (&ehci->lock, flags); 1044 - return; 1045 1044 } 1046 1045 1047 1046 static void
-1
drivers/usb/host/ohci-hcd.c
··· 370 370 } 371 371 ep->hcpriv = NULL; 372 372 spin_unlock_irqrestore (&ohci->lock, flags); 373 - return; 374 373 } 375 374 376 375 static int ohci_get_frame (struct usb_hcd *hcd)
-9
drivers/usb/host/oxu210hp-hcd.c
··· 544 544 qtd->buffer = NULL; 545 545 546 546 spin_unlock(&oxu->mem_lock); 547 - 548 - return; 549 547 } 550 548 551 549 static inline void ehci_qtd_init(struct ehci_qtd *qtd, dma_addr_t dma) ··· 569 571 oxu->qtd_used[index] = 0; 570 572 571 573 spin_unlock(&oxu->mem_lock); 572 - 573 - return; 574 574 } 575 575 576 576 static struct ehci_qtd *ehci_qtd_alloc(struct oxu_hcd *oxu) ··· 611 615 oxu->qh_used[index] = 0; 612 616 613 617 spin_unlock(&oxu->mem_lock); 614 - 615 - return; 616 618 } 617 619 618 620 static void qh_destroy(struct kref *kref) ··· 687 693 oxu->murb_used[index] = 0; 688 694 689 695 spin_unlock(&oxu->mem_lock); 690 - 691 - return; 692 696 } 693 697 694 698 static struct oxu_murb *oxu_murb_alloc(struct oxu_hcd *oxu) ··· 3065 3073 ep->hcpriv = NULL; 3066 3074 done: 3067 3075 spin_unlock_irqrestore(&oxu->lock, flags); 3068 - return; 3069 3076 } 3070 3077 3071 3078 static int oxu_get_frame(struct usb_hcd *hcd)
-2
drivers/usb/host/pci-quirks.c
··· 338 338 writel(0x3f, op_reg_base + EHCI_USBSTS); 339 339 340 340 iounmap(base); 341 - 342 - return; 343 341 } 344 342 345 343 /*
+2 -6
drivers/usb/host/u132-hcd.c
··· 316 316 } else if (queue_delayed_work(workqueue, &ring->scheduler, 0)) 317 317 return; 318 318 kref_put(&u132->kref, u132_hcd_delete); 319 - return; 320 319 } 321 320 322 321 static void u132_ring_queue_work(struct u132 *u132, struct u132_ring *ring, ··· 323 324 { 324 325 kref_get(&u132->kref); 325 326 u132_ring_requeue_work(u132, ring, delta); 326 - return; 327 327 } 328 328 329 329 static void u132_ring_cancel_work(struct u132 *u132, struct u132_ring *ring) ··· 541 543 mutex_unlock(&u132->scheduler_lock); 542 544 u132_endp_put_kref(u132, endp); 543 545 usb_hcd_giveback_urb(hcd, urb, status); 544 - return; 545 546 } 546 547 547 548 static void u132_hcd_forget_urb(struct u132 *u132, struct u132_endp *endp, ··· 571 574 endp->active = 0; 572 575 spin_unlock_irqrestore(&endp->queue_lock.slock, irqs); 573 576 kfree(urbq); 574 - } usb_hcd_giveback_urb(hcd, urb, status); 575 - return; 577 + } 578 + usb_hcd_giveback_urb(hcd, urb, status); 576 579 } 577 580 578 581 static inline int edset_input(struct u132 *u132, struct u132_ring *ring, ··· 3082 3085 u132->endp[endps] = NULL; 3083 3086 3084 3087 mutex_unlock(&u132->sw_lock); 3085 - return; 3086 3088 } 3087 3089 3088 3090 static int __devinit u132_probe(struct platform_device *pdev)
-9
drivers/usb/image/microtek.c
··· 398 398 context->srb->result = DID_ERROR << 16; 399 399 mts_transfer_cleanup(transfer); 400 400 } 401 - return; 402 401 } 403 402 404 403 ··· 408 409 409 410 if ( likely(context->final_callback != NULL) ) 410 411 context->final_callback(context->srb); 411 - 412 412 } 413 413 414 414 static void mts_transfer_done( struct urb *transfer ) ··· 418 420 context->srb->result |= (unsigned)(*context->scsi_status)<<1; 419 421 420 422 mts_transfer_cleanup(transfer); 421 - 422 - return; 423 423 } 424 424 425 425 ··· 448 452 } 449 453 450 454 mts_get_status(transfer); 451 - 452 - return; 453 455 } 454 456 455 457 ··· 490 496 mts_get_status(transfer); 491 497 } 492 498 } 493 - 494 - return; 495 499 } 496 500 497 501 static void mts_do_sg (struct urb* transfer) ··· 514 522 sg[context->fragment].length, 515 523 context->fragment + 1 == scsi_sg_count(context->srb) ? 516 524 mts_data_done : mts_do_sg); 517 - return; 518 525 } 519 526 520 527 static const u8 mts_read_image_sig[] = { 0x28, 00, 00, 00 };
-2
drivers/usb/misc/ftdi-elan.c
··· 456 456 static void ftdi_elan_kick_command_queue(struct usb_ftdi *ftdi) 457 457 { 458 458 ftdi_command_queue_work(ftdi, 0); 459 - return; 460 459 } 461 460 462 461 static void ftdi_elan_command_work(struct work_struct *work) ··· 482 483 static void ftdi_elan_kick_respond_queue(struct usb_ftdi *ftdi) 483 484 { 484 485 ftdi_respond_queue_work(ftdi, 0); 485 - return; 486 486 } 487 487 488 488 static void ftdi_elan_respond_work(struct work_struct *work)
-2
drivers/usb/mon/mon_main.c
··· 90 90 r->rnf_submit(r->r_data, urb); 91 91 } 92 92 spin_unlock_irqrestore(&mbus->lock, flags); 93 - return; 94 93 } 95 94 96 95 static void mon_submit(struct usb_bus *ubus, struct urb *urb) ··· 116 117 r->rnf_error(r->r_data, urb, error); 117 118 } 118 119 spin_unlock_irqrestore(&mbus->lock, flags); 119 - return; 120 120 } 121 121 122 122 static void mon_submit_error(struct usb_bus *ubus, struct urb *urb, int error)
-1
drivers/usb/musb/musb_gadget.c
··· 829 829 DBG(3, "packet waiting for %s%s request\n", 830 830 musb_ep->desc ? "" : "inactive ", 831 831 musb_ep->end_point.name); 832 - return; 833 832 } 834 833 835 834 /* ------------------------------------------------------------ */
-2
drivers/usb/serial/cypress_m8.c
··· 1320 1320 cypress_set_dead(port); 1321 1321 } 1322 1322 } 1323 - 1324 - return; 1325 1323 } /* cypress_read_int_callback */ 1326 1324 1327 1325
-1
drivers/usb/serial/ftdi_sio.c
··· 2065 2065 /* lower DTR/RTS */ 2066 2066 clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 2067 2067 } 2068 - return; 2069 2068 } 2070 2069 2071 2070 static int ftdi_tiocmget(struct tty_struct *tty, struct file *file)
-1
drivers/usb/serial/garmin_gps.c
··· 1264 1264 garmin_data_p->flags &= ~FLAGS_BULK_IN_ACTIVE; 1265 1265 spin_unlock_irqrestore(&garmin_data_p->lock, flags); 1266 1266 } 1267 - return; 1268 1267 } 1269 1268 1270 1269
-11
drivers/usb/serial/io_edgeport.c
··· 1465 1465 if (status != 0) 1466 1466 return; 1467 1467 } 1468 - 1469 - return; 1470 1468 } 1471 1469 1472 1470 ··· 1768 1770 dbg("%s - error sending break set/clear command.", 1769 1771 __func__); 1770 1772 } 1771 - 1772 - return; 1773 1773 } 1774 1774 1775 1775 ··· 2038 2042 dbg("%s - Unrecognized IOSP status code %u", __func__, code); 2039 2043 break; 2040 2044 } 2041 - return; 2042 2045 } 2043 2046 2044 2047 ··· 2090 2095 2091 2096 /* Save the new modem status */ 2092 2097 edge_port->shadowMSR = newMsr & 0xf0; 2093 - 2094 - return; 2095 2098 } 2096 2099 2097 2100 ··· 2136 2143 icount->parity++; 2137 2144 if (newLsr & LSR_FRM_ERR) 2138 2145 icount->frame++; 2139 - 2140 - return; 2141 2146 } 2142 2147 2143 2148 ··· 2711 2720 baud = tty_termios_baud_rate(old_termios); 2712 2721 tty_encode_baud_rate(tty, baud, baud); 2713 2722 } 2714 - return; 2715 2723 } 2716 2724 2717 2725 ··· 2912 2922 0x40, 0x4000, 0x0001, NULL, 0, 3000); 2913 2923 2914 2924 release_firmware(fw); 2915 - return; 2916 2925 } 2917 2926 2918 2927
-4
drivers/usb/serial/io_ti.c
··· 1571 1571 } 1572 1572 } 1573 1573 tty_kref_put(tty); 1574 - 1575 - return; 1576 1574 } 1577 1575 1578 1576 static void handle_new_lsr(struct edgeport_port *edge_port, int lsr_data, ··· 2422 2424 dbg("%s - error %d when trying to write config to device", 2423 2425 __func__, status); 2424 2426 kfree(config); 2425 - return; 2426 2427 } 2427 2428 2428 2429 static void edge_set_termios(struct tty_struct *tty, ··· 2442 2445 return; 2443 2446 /* change the port settings to the new ones specified */ 2444 2447 change_port_settings(tty, edge_port, old_termios); 2445 - return; 2446 2448 } 2447 2449 2448 2450 static int edge_tiocmset(struct tty_struct *tty, struct file *file,
-1
drivers/usb/serial/iuu_phoenix.c
··· 801 801 iuu_uart_read_callback, port); 802 802 result = usb_submit_urb(port->read_urb, GFP_ATOMIC); 803 803 dbg("%s - submit result = %d", __func__, result); 804 - return; 805 804 } 806 805 807 806 static int iuu_uart_on(struct usb_serial_port *port)
-1
drivers/usb/serial/keyspan_pda.c
··· 292 292 port->interrupt_in_urb->dev = port->serial->dev; 293 293 if (usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL)) 294 294 dbg(" usb_submit_urb(read urb) failed"); 295 - return; 296 295 } 297 296 298 297
-6
drivers/usb/serial/mos7720.c
··· 827 827 dev_err(&urb->dev->dev, 828 828 "%s - Error %d submitting control urb\n", 829 829 __func__, result); 830 - return; 831 830 } 832 831 833 832 /* ··· 906 907 dev_err(&urb->dev->dev, 907 908 "%s - Error %d submitting control urb\n", 908 909 __func__, result); 909 - return; 910 910 } 911 911 912 912 /* ··· 1225 1227 mos7720_port->shadowLCR = data; 1226 1228 write_mos_reg(serial, port->number - port->serial->minor, 1227 1229 LCR, mos7720_port->shadowLCR); 1228 - 1229 - return; 1230 1230 } 1231 1231 1232 1232 /* ··· 1742 1746 dbg("usb_submit_urb(read bulk) failed, status = %d", 1743 1747 status); 1744 1748 } 1745 - return; 1746 1749 } 1747 1750 1748 1751 /* ··· 1798 1803 dbg("usb_submit_urb(read bulk) failed, status = %d", 1799 1804 status); 1800 1805 } 1801 - return; 1802 1806 } 1803 1807 1804 1808 /*
-7
drivers/usb/serial/mos7840.c
··· 1355 1355 mos7840_port->shadowLCR); 1356 1356 mos7840_set_uart_reg(port, LINE_CONTROL_REGISTER, 1357 1357 mos7840_port->shadowLCR); 1358 - 1359 - return; 1360 1358 } 1361 1359 1362 1360 /***************************************************************************** ··· 1585 1587 if (status < 0) 1586 1588 return; 1587 1589 } 1588 - 1589 - return; 1590 1590 } 1591 1591 1592 1592 /***************************************************************************** ··· 2059 2063 mos7840_port->delta_msr_cond = 1; 2060 2064 dbg("mos7840_change_port_settings mos7840_port->shadowLCR is End %x", 2061 2065 mos7840_port->shadowLCR); 2062 - 2063 - return; 2064 2066 } 2065 2067 2066 2068 /***************************************************************************** ··· 2127 2133 mos7840_port->read_urb_busy = false; 2128 2134 } 2129 2135 } 2130 - return; 2131 2136 } 2132 2137 2133 2138 /*****************************************************************************
-2
drivers/usb/serial/omninet.c
··· 246 246 dev_err(&port->dev, 247 247 "%s - failed resubmitting read urb, error %d\n", 248 248 __func__, result); 249 - 250 - return; 251 249 } 252 250 253 251 static int omninet_write(struct tty_struct *tty, struct usb_serial_port *port,
-2
drivers/usb/serial/sierra.c
··· 620 620 dev_err(&port->dev, "resubmit read urb failed." 621 621 "(%d)\n", err); 622 622 } 623 - 624 - return; 625 623 } 626 624 627 625 static void sierra_instat_callback(struct urb *urb)
-1
drivers/usb/serial/spcp8x5.c
··· 441 441 spcp8x5_set_workMode(serial->dev, 0x000a, 442 442 SET_WORKING_MODE_U2C, priv->type); 443 443 } 444 - return; 445 444 } 446 445 447 446 /* open the serial port. do some usb system call. set termios and get the line
-1
drivers/usb/serial/usb_wwan.c
··· 234 234 } 235 235 236 236 } 237 - return; 238 237 } 239 238 240 239 static void usb_wwan_outdat_callback(struct urb *urb)
-6
drivers/usb/serial/whiteheat.c
··· 655 655 } 656 656 kfree(info); 657 657 } 658 - 659 - return; 660 658 } 661 659 662 660 static int whiteheat_open(struct tty_struct *tty, struct usb_serial_port *port) ··· 953 955 spin_lock_irq(&info->lock); 954 956 info->flags |= THROTTLED; 955 957 spin_unlock_irq(&info->lock); 956 - 957 - return; 958 958 } 959 959 960 960 ··· 971 975 972 976 if (actually_throttled) 973 977 rx_data_softint(&info->rx_work); 974 - 975 - return; 976 978 } 977 979 978 980