USB: fix codingstyle issues in drivers/usb/core/*.h

Fixes a number of coding style issues in the USB internal header files.

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

+68 -67
+45 -45
drivers/usb/core/hcd.h
··· 125 125 126 126 /* more shared queuing code would be good; it should support 127 127 * smarter scheduling, handle transaction translators, etc; 128 - * input size of periodic table to an interrupt scheduler. 128 + * input size of periodic table to an interrupt scheduler. 129 129 * (ohci 32, uhci 1024, ehci 256/512/1024). 130 130 */ 131 131 ··· 133 133 * this structure. 134 134 */ 135 135 unsigned long hcd_priv[0] 136 - __attribute__ ((aligned (sizeof(unsigned long)))); 136 + __attribute__ ((aligned(sizeof(unsigned long)))); 137 137 }; 138 138 139 139 /* 2.4 does this a bit differently ... */ 140 - static inline struct usb_bus *hcd_to_bus (struct usb_hcd *hcd) 140 + static inline struct usb_bus *hcd_to_bus(struct usb_hcd *hcd) 141 141 { 142 142 return &hcd->self; 143 143 } 144 144 145 - static inline struct usb_hcd *bus_to_hcd (struct usb_bus *bus) 145 + static inline struct usb_hcd *bus_to_hcd(struct usb_bus *bus) 146 146 { 147 147 return container_of(bus, struct usb_hcd, self); 148 148 } ··· 202 202 struct usb_host_endpoint *ep); 203 203 204 204 /* root hub support */ 205 - int (*hub_status_data) (struct usb_hcd *hcd, char *buf); 206 - int (*hub_control) (struct usb_hcd *hcd, 205 + int (*hub_status_data) (struct usb_hcd *hcd, char *buf); 206 + int (*hub_control) (struct usb_hcd *hcd, 207 207 u16 typeReq, u16 wValue, u16 wIndex, 208 208 char *buf, u16 wLength); 209 - int (*bus_suspend)(struct usb_hcd *); 210 - int (*bus_resume)(struct usb_hcd *); 211 - int (*start_port_reset)(struct usb_hcd *, unsigned port_num); 212 - void (*hub_irq_enable)(struct usb_hcd *); 209 + int (*bus_suspend)(struct usb_hcd *); 210 + int (*bus_resume)(struct usb_hcd *); 211 + int (*start_port_reset)(struct usb_hcd *, unsigned port_num); 212 + void (*hub_irq_enable)(struct usb_hcd *); 213 213 /* Needed only if port-change IRQs are level-triggered */ 214 214 215 215 /* force handover of high-speed port to full-speed companion */ 216 - void (*relinquish_port)(struct usb_hcd *, int); 216 + void (*relinquish_port)(struct usb_hcd *, int); 217 217 }; 218 218 219 219 extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); ··· 221 221 int status); 222 222 extern void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd, struct urb *urb); 223 223 224 - extern int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags); 225 - extern int usb_hcd_unlink_urb (struct urb *urb, int status); 224 + extern int usb_hcd_submit_urb(struct urb *urb, gfp_t mem_flags); 225 + extern int usb_hcd_unlink_urb(struct urb *urb, int status); 226 226 extern void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, 227 227 int status); 228 228 extern void usb_hcd_flush_endpoint(struct usb_device *udev, 229 229 struct usb_host_endpoint *ep); 230 230 extern void usb_hcd_disable_endpoint(struct usb_device *udev, 231 231 struct usb_host_endpoint *ep); 232 - extern int usb_hcd_get_frame_number (struct usb_device *udev); 232 + extern int usb_hcd_get_frame_number(struct usb_device *udev); 233 233 234 - extern struct usb_hcd *usb_create_hcd (const struct hc_driver *driver, 234 + extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver, 235 235 struct device *dev, char *bus_name); 236 - extern struct usb_hcd *usb_get_hcd (struct usb_hcd *hcd); 237 - extern void usb_put_hcd (struct usb_hcd *hcd); 236 + extern struct usb_hcd *usb_get_hcd(struct usb_hcd *hcd); 237 + extern void usb_put_hcd(struct usb_hcd *hcd); 238 238 extern int usb_add_hcd(struct usb_hcd *hcd, 239 239 unsigned int irqnum, unsigned long irqflags); 240 240 extern void usb_remove_hcd(struct usb_hcd *hcd); 241 241 242 242 struct platform_device; 243 - extern void usb_hcd_platform_shutdown(struct platform_device* dev); 243 + extern void usb_hcd_platform_shutdown(struct platform_device *dev); 244 244 245 245 #ifdef CONFIG_PCI 246 246 struct pci_dev; 247 247 struct pci_device_id; 248 - extern int usb_hcd_pci_probe (struct pci_dev *dev, 248 + extern int usb_hcd_pci_probe(struct pci_dev *dev, 249 249 const struct pci_device_id *id); 250 - extern void usb_hcd_pci_remove (struct pci_dev *dev); 250 + extern void usb_hcd_pci_remove(struct pci_dev *dev); 251 251 252 252 #ifdef CONFIG_PM 253 - extern int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t state); 254 - extern int usb_hcd_pci_resume (struct pci_dev *dev); 253 + extern int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t state); 254 + extern int usb_hcd_pci_resume(struct pci_dev *dev); 255 255 #endif /* CONFIG_PM */ 256 256 257 - extern void usb_hcd_pci_shutdown (struct pci_dev *dev); 257 + extern void usb_hcd_pci_shutdown(struct pci_dev *dev); 258 258 259 259 #endif /* CONFIG_PCI */ 260 260 261 261 /* pci-ish (pdev null is ok) buffer alloc/mapping support */ 262 - int hcd_buffer_create (struct usb_hcd *hcd); 263 - void hcd_buffer_destroy (struct usb_hcd *hcd); 262 + int hcd_buffer_create(struct usb_hcd *hcd); 263 + void hcd_buffer_destroy(struct usb_hcd *hcd); 264 264 265 - void *hcd_buffer_alloc (struct usb_bus *bus, size_t size, 265 + void *hcd_buffer_alloc(struct usb_bus *bus, size_t size, 266 266 gfp_t mem_flags, dma_addr_t *dma); 267 - void hcd_buffer_free (struct usb_bus *bus, size_t size, 267 + void hcd_buffer_free(struct usb_bus *bus, size_t size, 268 268 void *addr, dma_addr_t dma); 269 269 270 270 /* generic bus glue, needed for host controllers that don't use PCI */ 271 - extern irqreturn_t usb_hcd_irq (int irq, void *__hcd); 271 + extern irqreturn_t usb_hcd_irq(int irq, void *__hcd); 272 272 273 - extern void usb_hc_died (struct usb_hcd *hcd); 273 + extern void usb_hc_died(struct usb_hcd *hcd); 274 274 extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd); 275 275 276 276 /* -------------------------------------------------------------------------- */ ··· 323 323 * Generic bandwidth allocation constants/support 324 324 */ 325 325 #define FRAME_TIME_USECS 1000L 326 - #define BitTime(bytecount) (7 * 8 * bytecount / 6) /* with integer truncation */ 326 + #define BitTime(bytecount) (7 * 8 * bytecount / 6) /* with integer truncation */ 327 327 /* Trying not to use worst-case bit-stuffing 328 - of (7/6 * 8 * bytecount) = 9.33 * bytecount */ 328 + * of (7/6 * 8 * bytecount) = 9.33 * bytecount */ 329 329 /* bytecount = data payload byte count */ 330 330 331 331 #define NS_TO_US(ns) ((ns + 500L) / 1000L) ··· 337 337 */ 338 338 #define BW_HOST_DELAY 1000L /* nanoseconds */ 339 339 #define BW_HUB_LS_SETUP 333L /* nanoseconds */ 340 - /* 4 full-speed bit times (est.) */ 340 + /* 4 full-speed bit times (est.) */ 341 341 342 - #define FRAME_TIME_BITS 12000L /* frame = 1 millisecond */ 342 + #define FRAME_TIME_BITS 12000L /* frame = 1 millisecond */ 343 343 #define FRAME_TIME_MAX_BITS_ALLOC (90L * FRAME_TIME_BITS / 100L) 344 344 #define FRAME_TIME_MAX_USECS_ALLOC (90L * FRAME_TIME_USECS / 100L) 345 345 ··· 349 349 * to preallocate bandwidth) 350 350 */ 351 351 #define USB2_HOST_DELAY 5 /* nsec, guess */ 352 - #define HS_NSECS(bytes) ( ((55 * 8 * 2083) \ 352 + #define HS_NSECS(bytes) (((55 * 8 * 2083) \ 353 353 + (2083UL * (3 + BitTime(bytes))))/1000 \ 354 354 + USB2_HOST_DELAY) 355 - #define HS_NSECS_ISO(bytes) ( ((38 * 8 * 2083) \ 355 + #define HS_NSECS_ISO(bytes) (((38 * 8 * 2083) \ 356 356 + (2083UL * (3 + BitTime(bytes))))/1000 \ 357 357 + USB2_HOST_DELAY) 358 358 #define HS_USECS(bytes) NS_TO_US (HS_NSECS(bytes)) 359 359 #define HS_USECS_ISO(bytes) NS_TO_US (HS_NSECS_ISO(bytes)) 360 360 361 - extern long usb_calc_bus_time (int speed, int is_input, 361 + extern long usb_calc_bus_time(int speed, int is_input, 362 362 int isoc, int bytecount); 363 363 364 364 /*-------------------------------------------------------------------------*/ ··· 374 374 extern struct mutex usb_bus_list_lock; 375 375 extern wait_queue_head_t usb_kill_urb_queue; 376 376 377 - extern void usb_enable_root_hub_irq (struct usb_bus *bus); 377 + extern void usb_enable_root_hub_irq(struct usb_bus *bus); 378 378 379 - extern int usb_find_interface_driver (struct usb_device *dev, 379 + extern int usb_find_interface_driver(struct usb_device *dev, 380 380 struct usb_interface *interface); 381 381 382 382 #define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN)) 383 383 384 384 #ifdef CONFIG_PM 385 - extern void usb_hcd_resume_root_hub (struct usb_hcd *hcd); 386 - extern void usb_root_hub_lost_power (struct usb_device *rhdev); 385 + extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); 386 + extern void usb_root_hub_lost_power(struct usb_device *rhdev); 387 387 extern int hcd_bus_suspend(struct usb_device *rhdev); 388 388 extern int hcd_bus_resume(struct usb_device *rhdev); 389 389 #else ··· 403 403 * these are expected to be called from the USB core/hub thread 404 404 * with the kernel lock held 405 405 */ 406 - extern void usbfs_update_special (void); 406 + extern void usbfs_update_special(void); 407 407 extern int usbfs_init(void); 408 408 extern void usbfs_cleanup(void); 409 409 410 410 #else /* CONFIG_USB_DEVICEFS */ 411 411 412 - static inline void usbfs_update_special (void) {} 412 + static inline void usbfs_update_special(void) {} 413 413 static inline int usbfs_init(void) { return 0; } 414 414 static inline void usbfs_cleanup(void) { } 415 415 ··· 464 464 /*-------------------------------------------------------------------------*/ 465 465 466 466 /* hub.h ... DeviceRemovable in 2.4.2-ac11, gone in 2.4.10 */ 467 - // bleech -- resurfaced in 2.4.11 or 2.4.12 467 + /* bleech -- resurfaced in 2.4.11 or 2.4.12 */ 468 468 #define bitmap DeviceRemovable 469 469 470 470 ··· 472 472 473 473 /* random stuff */ 474 474 475 - #define RUN_CONTEXT (in_irq () ? "in_irq" \ 476 - : (in_interrupt () ? "in_interrupt" : "can sleep")) 475 + #define RUN_CONTEXT (in_irq() ? "in_irq" \ 476 + : (in_interrupt() ? "in_interrupt" : "can sleep")) 477 477 478 478 479 479 /* This rwsem is for use only by the hub driver and ehci-hcd.
+9 -9
drivers/usb/core/hub.h
··· 55 55 #define USB_PORT_FEAT_TEST 21 56 56 #define USB_PORT_FEAT_INDICATOR 22 57 57 58 - /* 58 + /* 59 59 * Hub Status and Hub Change results 60 60 * See USB 2.0 spec Table 11-19 and Table 11-20 61 61 */ 62 62 struct usb_port_status { 63 63 __le16 wPortStatus; 64 - __le16 wPortChange; 64 + __le16 wPortChange; 65 65 } __attribute__ ((packed)); 66 66 67 - /* 67 + /* 68 68 * wPortStatus bit field 69 69 * See USB 2.0 spec Table 11-21 70 70 */ ··· 81 81 #define USB_PORT_STAT_INDICATOR 0x1000 82 82 /* bits 13 to 15 are reserved */ 83 83 84 - /* 84 + /* 85 85 * wPortChange bit field 86 86 * See USB 2.0 spec Table 11-22 87 87 * Bits 0 to 4 shown, bits 5 to 15 are reserved ··· 93 93 #define USB_PORT_STAT_C_RESET 0x0010 94 94 95 95 /* 96 - * wHubCharacteristics (masks) 96 + * wHubCharacteristics (masks) 97 97 * See USB 2.0 spec Table 11-13, offset 3 98 98 */ 99 99 #define HUB_CHAR_LPSM 0x0003 /* D1 .. D0 */ ··· 119 119 #define HUB_CHANGE_OVERCURRENT 0x0002 120 120 121 121 122 - /* 123 - * Hub descriptor 122 + /* 123 + * Hub descriptor 124 124 * See USB 2.0 spec Table 11-13 125 125 */ 126 126 ··· 134 134 __le16 wHubCharacteristics; 135 135 __u8 bPwrOn2PwrGood; 136 136 __u8 bHubContrCurrent; 137 - /* add 1 bit for hub status change; round to bytes */ 137 + /* add 1 bit for hub status change; round to bytes */ 138 138 __u8 DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8]; 139 139 __u8 PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8]; 140 140 } __attribute__ ((packed)); ··· 190 190 u16 devinfo; 191 191 }; 192 192 193 - extern void usb_hub_tt_clear_buffer (struct usb_device *dev, int pipe); 193 + extern void usb_hub_tt_clear_buffer(struct usb_device *dev, int pipe); 194 194 195 195 #endif /* __LINUX_HUB_H */
+3 -3
drivers/usb/core/otg_whitelist.h
··· 14 14 * mostly use of USB_DEVICE() or USB_DEVICE_VER() entries.. 15 15 * 16 16 * YOU _SHOULD_ CHANGE THIS LIST TO MATCH YOUR PRODUCT AND ITS TESTING! 17 - */ 17 + */ 18 18 19 19 static struct usb_device_id whitelist_table [] = { 20 20 ··· 55 55 return 1; 56 56 57 57 /* HNP test device is _never_ targeted (see OTG spec 6.6.6) */ 58 - if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a && 58 + if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a && 59 59 le16_to_cpu(dev->descriptor.idProduct) == 0xbadd)) 60 60 return 0; 61 61 ··· 86 86 continue; 87 87 88 88 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) && 89 - (id->bDeviceSubClass!= dev->descriptor.bDeviceSubClass)) 89 + (id->bDeviceSubClass != dev->descriptor.bDeviceSubClass)) 90 90 continue; 91 91 92 92 if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) &&
+11 -10
drivers/usb/core/usb.h
··· 1 1 /* Functions local to drivers/usb/core/ */ 2 2 3 - extern int usb_create_sysfs_dev_files (struct usb_device *dev); 4 - extern void usb_remove_sysfs_dev_files (struct usb_device *dev); 5 - extern int usb_create_sysfs_intf_files (struct usb_interface *intf); 6 - extern void usb_remove_sysfs_intf_files (struct usb_interface *intf); 7 - extern int usb_create_ep_files(struct device *parent, struct usb_host_endpoint *endpoint, 3 + extern int usb_create_sysfs_dev_files(struct usb_device *dev); 4 + extern void usb_remove_sysfs_dev_files(struct usb_device *dev); 5 + extern int usb_create_sysfs_intf_files(struct usb_interface *intf); 6 + extern void usb_remove_sysfs_intf_files(struct usb_interface *intf); 7 + extern int usb_create_ep_files(struct device *parent, 8 + struct usb_host_endpoint *endpoint, 8 9 struct usb_device *udev); 9 10 extern void usb_remove_ep_files(struct usb_host_endpoint *endpoint); 10 11 11 12 extern void usb_enable_endpoint(struct usb_device *dev, 12 13 struct usb_host_endpoint *ep); 13 - extern void usb_disable_endpoint (struct usb_device *dev, unsigned int epaddr); 14 - extern void usb_disable_interface (struct usb_device *dev, 14 + extern void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr); 15 + extern void usb_disable_interface(struct usb_device *dev, 15 16 struct usb_interface *intf); 16 17 extern void usb_release_interface_cache(struct kref *ref); 17 - extern void usb_disable_device (struct usb_device *dev, int skip_ep0); 18 - extern int usb_deauthorize_device (struct usb_device *); 19 - extern int usb_authorize_device (struct usb_device *); 18 + extern void usb_disable_device(struct usb_device *dev, int skip_ep0); 19 + extern int usb_deauthorize_device(struct usb_device *); 20 + extern int usb_authorize_device(struct usb_device *); 20 21 extern void usb_detect_quirks(struct usb_device *udev); 21 22 22 23 extern int usb_get_device_descriptor(struct usb_device *dev,