USB: fix codingstyle issues in include/linux/usb.h

No logical code changes were made, but checkpatch.pl is much happier now.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+113 -91
+113 -91
include/linux/usb.h
··· 162 162 unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ 163 163 164 164 struct device dev; /* interface specific device info */ 165 - struct device *usb_dev; /* pointer to the usb class's device, if any */ 165 + struct device *usb_dev; 166 166 int pm_usage_cnt; /* usage counter for autosuspend */ 167 167 }; 168 168 #define to_usb_interface(d) container_of(d, struct usb_interface, dev) 169 169 #define interface_to_usbdev(intf) \ 170 170 container_of(intf->dev.parent, struct usb_device, dev) 171 171 172 - static inline void *usb_get_intfdata (struct usb_interface *intf) 172 + static inline void *usb_get_intfdata(struct usb_interface *intf) 173 173 { 174 - return dev_get_drvdata (&intf->dev); 174 + return dev_get_drvdata(&intf->dev); 175 175 } 176 176 177 - static inline void usb_set_intfdata (struct usb_interface *intf, void *data) 177 + static inline void usb_set_intfdata(struct usb_interface *intf, void *data) 178 178 { 179 179 dev_set_drvdata(&intf->dev, data); 180 180 } ··· 275 275 276 276 int __usb_get_extra_descriptor(char *buffer, unsigned size, 277 277 unsigned char type, void **ptr); 278 - #define usb_get_extra_descriptor(ifpoint,type,ptr)\ 279 - __usb_get_extra_descriptor((ifpoint)->extra,(ifpoint)->extralen,\ 280 - type,(void**)ptr) 278 + #define usb_get_extra_descriptor(ifpoint, type, ptr) \ 279 + __usb_get_extra_descriptor((ifpoint)->extra, \ 280 + (ifpoint)->extralen, \ 281 + type, (void **)ptr) 281 282 282 283 /* ----------------------------------------------------------------------- */ 283 284 ··· 389 388 unsigned can_submit:1; /* URBs may be submitted */ 390 389 unsigned discon_suspended:1; /* Disconnected while suspended */ 391 390 unsigned have_langid:1; /* whether string_langid is valid */ 392 - unsigned authorized:1; /* Policy has determined we can use it */ 391 + unsigned authorized:1; /* Policy has said we can use it */ 393 392 unsigned wusb:1; /* Device is Wireless USB */ 394 393 int string_langid; /* language ID for strings */ 395 394 ··· 418 417 419 418 int pm_usage_cnt; /* usage counter for autosuspend */ 420 419 u32 quirks; /* quirks of the whole device */ 421 - atomic_t urbnum; /* number of URBs submitted for the whole device */ 420 + atomic_t urbnum; /* number of URBs submitted for 421 + the whole device */ 422 422 423 423 unsigned long active_duration; /* total time device is not suspended */ 424 424 ··· 503 501 /*-------------------------------------------------------------------------*/ 504 502 505 503 /* for drivers using iso endpoints */ 506 - extern int usb_get_current_frame_number (struct usb_device *usb_dev); 504 + extern int usb_get_current_frame_number(struct usb_device *usb_dev); 507 505 508 506 /* used these for multi-interface device registration */ 509 507 extern int usb_driver_claim_interface(struct usb_driver *driver, 510 - struct usb_interface *iface, void* priv); 508 + struct usb_interface *iface, void *priv); 511 509 512 510 /** 513 511 * usb_interface_claimed - returns true iff an interface is claimed ··· 519 517 * may need to explicitly claim that lock. 520 518 * 521 519 */ 522 - static inline int usb_interface_claimed(struct usb_interface *iface) { 520 + static inline int usb_interface_claimed(struct usb_interface *iface) 521 + { 523 522 return (iface->dev.driver != NULL); 524 523 } 525 524 ··· 563 560 * USB 2.0 root hubs (EHCI host controllers) will get one path ID if they are 564 561 * high speed, and a different one if they are full or low speed. 565 562 */ 566 - static inline int usb_make_path (struct usb_device *dev, char *buf, 567 - size_t size) 563 + static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size) 568 564 { 569 565 int actual; 570 - actual = snprintf (buf, size, "usb-%s-%s", dev->bus->bus_name, 571 - dev->devpath); 566 + actual = snprintf(buf, size, "usb-%s-%s", dev->bus->bus_name, 567 + dev->devpath); 572 568 return (actual >= (int)size) ? -1 : actual; 573 569 } 574 570 ··· 613 611 * 614 612 * Returns true if the endpoint is of type OUT, otherwise it returns false. 615 613 */ 616 - static inline int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd) 614 + static inline int usb_endpoint_dir_out( 615 + const struct usb_endpoint_descriptor *epd) 617 616 { 618 617 return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT); 619 618 } ··· 625 622 * 626 623 * Returns true if the endpoint is of type bulk, otherwise it returns false. 627 624 */ 628 - static inline int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd) 625 + static inline int usb_endpoint_xfer_bulk( 626 + const struct usb_endpoint_descriptor *epd) 629 627 { 630 628 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == 631 629 USB_ENDPOINT_XFER_BULK); ··· 638 634 * 639 635 * Returns true if the endpoint is of type control, otherwise it returns false. 640 636 */ 641 - static inline int usb_endpoint_xfer_control(const struct usb_endpoint_descriptor *epd) 637 + static inline int usb_endpoint_xfer_control( 638 + const struct usb_endpoint_descriptor *epd) 642 639 { 643 640 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == 644 641 USB_ENDPOINT_XFER_CONTROL); ··· 652 647 * Returns true if the endpoint is of type interrupt, otherwise it returns 653 648 * false. 654 649 */ 655 - static inline int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd) 650 + static inline int usb_endpoint_xfer_int( 651 + const struct usb_endpoint_descriptor *epd) 656 652 { 657 653 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == 658 654 USB_ENDPOINT_XFER_INT); ··· 666 660 * Returns true if the endpoint is of type isochronous, otherwise it returns 667 661 * false. 668 662 */ 669 - static inline int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd) 663 + static inline int usb_endpoint_xfer_isoc( 664 + const struct usb_endpoint_descriptor *epd) 670 665 { 671 666 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == 672 667 USB_ENDPOINT_XFER_ISOC); ··· 680 673 * Returns true if the endpoint has bulk transfer type and IN direction, 681 674 * otherwise it returns false. 682 675 */ 683 - static inline int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd) 676 + static inline int usb_endpoint_is_bulk_in( 677 + const struct usb_endpoint_descriptor *epd) 684 678 { 685 679 return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd)); 686 680 } ··· 693 685 * Returns true if the endpoint has bulk transfer type and OUT direction, 694 686 * otherwise it returns false. 695 687 */ 696 - static inline int usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd) 688 + static inline int usb_endpoint_is_bulk_out( 689 + const struct usb_endpoint_descriptor *epd) 697 690 { 698 691 return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd)); 699 692 } ··· 706 697 * Returns true if the endpoint has interrupt transfer type and IN direction, 707 698 * otherwise it returns false. 708 699 */ 709 - static inline int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) 700 + static inline int usb_endpoint_is_int_in( 701 + const struct usb_endpoint_descriptor *epd) 710 702 { 711 703 return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd)); 712 704 } ··· 719 709 * Returns true if the endpoint has interrupt transfer type and OUT direction, 720 710 * otherwise it returns false. 721 711 */ 722 - static inline int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd) 712 + static inline int usb_endpoint_is_int_out( 713 + const struct usb_endpoint_descriptor *epd) 723 714 { 724 715 return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd)); 725 716 } ··· 732 721 * Returns true if the endpoint has isochronous transfer type and IN direction, 733 722 * otherwise it returns false. 734 723 */ 735 - static inline int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor *epd) 724 + static inline int usb_endpoint_is_isoc_in( 725 + const struct usb_endpoint_descriptor *epd) 736 726 { 737 727 return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd)); 738 728 } ··· 745 733 * Returns true if the endpoint has isochronous transfer type and OUT direction, 746 734 * otherwise it returns false. 747 735 */ 748 - static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor *epd) 736 + static inline int usb_endpoint_is_isoc_out( 737 + const struct usb_endpoint_descriptor *epd) 749 738 { 750 739 return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd)); 751 740 } ··· 777 764 * specific device. 778 765 */ 779 766 #define USB_DEVICE(vend,prod) \ 780 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = (vend), \ 781 - .idProduct = (prod) 767 + .match_flags = USB_DEVICE_ID_MATCH_DEVICE, \ 768 + .idVendor = (vend), \ 769 + .idProduct = (prod) 782 770 /** 783 771 * USB_DEVICE_VER - macro used to describe a specific usb device with a 784 772 * version range ··· 791 777 * This macro is used to create a struct usb_device_id that matches a 792 778 * specific device, with a version range. 793 779 */ 794 - #define USB_DEVICE_VER(vend,prod,lo,hi) \ 780 + #define USB_DEVICE_VER(vend, prod, lo, hi) \ 795 781 .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, \ 796 - .idVendor = (vend), .idProduct = (prod), \ 797 - .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) 782 + .idVendor = (vend), \ 783 + .idProduct = (prod), \ 784 + .bcdDevice_lo = (lo), \ 785 + .bcdDevice_hi = (hi) 798 786 799 787 /** 800 788 * USB_DEVICE_INTERFACE_PROTOCOL - macro used to describe a usb ··· 808 792 * This macro is used to create a struct usb_device_id that matches a 809 793 * specific interface protocol of devices. 810 794 */ 811 - #define USB_DEVICE_INTERFACE_PROTOCOL(vend,prod,pr) \ 812 - .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_PROTOCOL, \ 795 + #define USB_DEVICE_INTERFACE_PROTOCOL(vend, prod, pr) \ 796 + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ 797 + USB_DEVICE_ID_MATCH_INT_PROTOCOL, \ 813 798 .idVendor = (vend), \ 814 799 .idProduct = (prod), \ 815 800 .bInterfaceProtocol = (pr) ··· 824 807 * This macro is used to create a struct usb_device_id that matches a 825 808 * specific class of devices. 826 809 */ 827 - #define USB_DEVICE_INFO(cl,sc,pr) \ 828 - .match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, .bDeviceClass = (cl), \ 829 - .bDeviceSubClass = (sc), .bDeviceProtocol = (pr) 810 + #define USB_DEVICE_INFO(cl, sc, pr) \ 811 + .match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, \ 812 + .bDeviceClass = (cl), \ 813 + .bDeviceSubClass = (sc), \ 814 + .bDeviceProtocol = (pr) 830 815 831 816 /** 832 - * USB_INTERFACE_INFO - macro used to describe a class of usb interfaces 817 + * USB_INTERFACE_INFO - macro used to describe a class of usb interfaces 833 818 * @cl: bInterfaceClass value 834 819 * @sc: bInterfaceSubClass value 835 820 * @pr: bInterfaceProtocol value ··· 839 820 * This macro is used to create a struct usb_device_id that matches a 840 821 * specific class of interfaces. 841 822 */ 842 - #define USB_INTERFACE_INFO(cl,sc,pr) \ 843 - .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \ 844 - .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) 823 + #define USB_INTERFACE_INFO(cl, sc, pr) \ 824 + .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, \ 825 + .bInterfaceClass = (cl), \ 826 + .bInterfaceSubClass = (sc), \ 827 + .bInterfaceProtocol = (pr) 845 828 846 829 /** 847 830 * USB_DEVICE_AND_INTERFACE_INFO - macro used to describe a specific usb device ··· 860 839 * This is especially useful when explicitly matching devices that have 861 840 * vendor specific bDeviceClass values, but standards-compliant interfaces. 862 841 */ 863 - #define USB_DEVICE_AND_INTERFACE_INFO(vend,prod,cl,sc,pr) \ 842 + #define USB_DEVICE_AND_INTERFACE_INFO(vend, prod, cl, sc, pr) \ 864 843 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ 865 844 | USB_DEVICE_ID_MATCH_DEVICE, \ 866 - .idVendor = (vend), .idProduct = (prod), \ 845 + .idVendor = (vend), \ 846 + .idProduct = (prod), \ 867 847 .bInterfaceClass = (cl), \ 868 - .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) 848 + .bInterfaceSubClass = (sc), \ 849 + .bInterfaceProtocol = (pr) 869 850 870 851 /* ----------------------------------------------------------------------- */ 871 852 ··· 1145 1122 * transferred. It will normally be the same as requested, unless 1146 1123 * either an error was reported or a short read was performed. 1147 1124 * The URB_SHORT_NOT_OK transfer flag may be used to make such 1148 - * short reads be reported as errors. 1125 + * short reads be reported as errors. 1149 1126 * @setup_packet: Only used for control transfers, this points to eight bytes 1150 1127 * of setup data. Control transfers always start by sending this data 1151 1128 * to the device. Then transfer_buffer is read or written, if needed. ··· 1164 1141 * @complete: Completion handler. This URB is passed as the parameter to the 1165 1142 * completion function. The completion function may then do what 1166 1143 * it likes with the URB, including resubmitting or freeing it. 1167 - * @iso_frame_desc: Used to provide arrays of ISO transfer buffers and to 1144 + * @iso_frame_desc: Used to provide arrays of ISO transfer buffers and to 1168 1145 * collect the transfer status for each buffer. 1169 1146 * 1170 1147 * This structure identifies USB transfer requests. URBs must be allocated by ··· 1268 1245 * when the urb is owned by the hcd, that is, since the call to 1269 1246 * usb_submit_urb() till the entry into the completion routine. 1270 1247 */ 1271 - struct urb 1272 - { 1248 + struct urb { 1273 1249 /* private: usb core and host controller only fields in the urb */ 1274 1250 struct kref kref; /* reference count of the URB */ 1275 1251 void *hcpriv; /* private data for host controller */ ··· 1279 1257 /* public: documented fields in the urb that can be used by drivers */ 1280 1258 struct list_head urb_list; /* list head for use by the urb's 1281 1259 * current owner */ 1282 - struct list_head anchor_list; /* the URB may be anchored by the driver */ 1260 + struct list_head anchor_list; /* the URB may be anchored */ 1283 1261 struct usb_anchor *anchor; 1284 1262 struct usb_device *dev; /* (in) pointer to associated device */ 1285 - struct usb_host_endpoint *ep; /* (internal) pointer to endpoint struct */ 1263 + struct usb_host_endpoint *ep; /* (internal) pointer to endpoint */ 1286 1264 unsigned int pipe; /* (in) pipe information */ 1287 1265 int status; /* (return) non-ISO status */ 1288 1266 unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ ··· 1319 1297 * Initializes a control urb with the proper information needed to submit 1320 1298 * it to a device. 1321 1299 */ 1322 - static inline void usb_fill_control_urb (struct urb *urb, 1323 - struct usb_device *dev, 1324 - unsigned int pipe, 1325 - unsigned char *setup_packet, 1326 - void *transfer_buffer, 1327 - int buffer_length, 1328 - usb_complete_t complete_fn, 1329 - void *context) 1300 + static inline void usb_fill_control_urb(struct urb *urb, 1301 + struct usb_device *dev, 1302 + unsigned int pipe, 1303 + unsigned char *setup_packet, 1304 + void *transfer_buffer, 1305 + int buffer_length, 1306 + usb_complete_t complete_fn, 1307 + void *context) 1330 1308 { 1331 1309 urb->dev = dev; 1332 1310 urb->pipe = pipe; ··· 1350 1328 * Initializes a bulk urb with the proper information needed to submit it 1351 1329 * to a device. 1352 1330 */ 1353 - static inline void usb_fill_bulk_urb (struct urb *urb, 1354 - struct usb_device *dev, 1355 - unsigned int pipe, 1356 - void *transfer_buffer, 1357 - int buffer_length, 1358 - usb_complete_t complete_fn, 1359 - void *context) 1331 + static inline void usb_fill_bulk_urb(struct urb *urb, 1332 + struct usb_device *dev, 1333 + unsigned int pipe, 1334 + void *transfer_buffer, 1335 + int buffer_length, 1336 + usb_complete_t complete_fn, 1337 + void *context) 1360 1338 { 1361 1339 urb->dev = dev; 1362 1340 urb->pipe = pipe; ··· 1384 1362 * the endpoint interval, and express polling intervals in microframes 1385 1363 * (eight per millisecond) rather than in frames (one per millisecond). 1386 1364 */ 1387 - static inline void usb_fill_int_urb (struct urb *urb, 1388 - struct usb_device *dev, 1389 - unsigned int pipe, 1390 - void *transfer_buffer, 1391 - int buffer_length, 1392 - usb_complete_t complete_fn, 1393 - void *context, 1394 - int interval) 1365 + static inline void usb_fill_int_urb(struct urb *urb, 1366 + struct usb_device *dev, 1367 + unsigned int pipe, 1368 + void *transfer_buffer, 1369 + int buffer_length, 1370 + usb_complete_t complete_fn, 1371 + void *context, 1372 + int interval) 1395 1373 { 1396 1374 urb->dev = dev; 1397 1375 urb->pipe = pipe; ··· 1444 1422 return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT; 1445 1423 } 1446 1424 1447 - void *usb_buffer_alloc (struct usb_device *dev, size_t size, 1425 + void *usb_buffer_alloc(struct usb_device *dev, size_t size, 1448 1426 gfp_t mem_flags, dma_addr_t *dma); 1449 - void usb_buffer_free (struct usb_device *dev, size_t size, 1427 + void usb_buffer_free(struct usb_device *dev, size_t size, 1450 1428 void *addr, dma_addr_t dma); 1451 1429 1452 1430 #if 0 1453 - struct urb *usb_buffer_map (struct urb *urb); 1454 - void usb_buffer_dmasync (struct urb *urb); 1455 - void usb_buffer_unmap (struct urb *urb); 1431 + struct urb *usb_buffer_map(struct urb *urb); 1432 + void usb_buffer_dmasync(struct urb *urb); 1433 + void usb_buffer_unmap(struct urb *urb); 1456 1434 #endif 1457 1435 1458 1436 struct scatterlist; ··· 1524 1502 int status; 1525 1503 size_t bytes; 1526 1504 1527 - /* 1505 + /* 1528 1506 * members below are private: to usbcore, 1529 1507 * and are not provided for driver access! 1530 1508 */ ··· 1542 1520 struct completion complete; 1543 1521 }; 1544 1522 1545 - int usb_sg_init ( 1523 + int usb_sg_init( 1546 1524 struct usb_sg_request *io, 1547 1525 struct usb_device *dev, 1548 - unsigned pipe, 1526 + unsigned pipe, 1549 1527 unsigned period, 1550 1528 struct scatterlist *sg, 1551 1529 int nents, 1552 1530 size_t length, 1553 1531 gfp_t mem_flags 1554 1532 ); 1555 - void usb_sg_cancel (struct usb_sg_request *io); 1556 - void usb_sg_wait (struct usb_sg_request *io); 1533 + void usb_sg_cancel(struct usb_sg_request *io); 1534 + void usb_sg_wait(struct usb_sg_request *io); 1557 1535 1558 1536 1559 1537 /* ----------------------------------------------------------------------- */ ··· 1610 1588 1611 1589 /* Create various pipes... */ 1612 1590 #define usb_sndctrlpipe(dev,endpoint) \ 1613 - ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint)) 1591 + ((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint)) 1614 1592 #define usb_rcvctrlpipe(dev,endpoint) \ 1615 - ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) 1593 + ((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) 1616 1594 #define usb_sndisocpipe(dev,endpoint) \ 1617 - ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint)) 1595 + ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint)) 1618 1596 #define usb_rcvisocpipe(dev,endpoint) \ 1619 - ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) 1597 + ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) 1620 1598 #define usb_sndbulkpipe(dev,endpoint) \ 1621 - ((PIPE_BULK << 30) | __create_pipe(dev,endpoint)) 1599 + ((PIPE_BULK << 30) | __create_pipe(dev, endpoint)) 1622 1600 #define usb_rcvbulkpipe(dev,endpoint) \ 1623 - ((PIPE_BULK << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) 1601 + ((PIPE_BULK << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) 1624 1602 #define usb_sndintpipe(dev,endpoint) \ 1625 - ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint)) 1603 + ((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint)) 1626 1604 #define usb_rcvintpipe(dev,endpoint) \ 1627 - ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) 1605 + ((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) 1628 1606 1629 1607 /*-------------------------------------------------------------------------*/ 1630 1608