diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2013-10-05 12:02:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-05 21:00:08 -0400 |
commit | 14557359cad5d18ae18f8e9b01639022557ff71b (patch) | |
tree | c538cd4ffbde0b757d91aa3cfd5adb612434f100 /drivers/usb/core | |
parent | 842c19600728dc2561f06553e442031fc68c1882 (diff) |
drivers: usb: core: hcd: Whitespace fixes
including
- spaces to tabs
- removing spaces before array indexing (foo [] to foo[])
- adding spaces around unary operator (foo? 1 : 0 to foo ? 1 : 0)
- removed trailing whitespace
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/hcd.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index a063e48a7fe5..138ed82a225a 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * (C) Copyright Deti Fliegl 1999 | 6 | * (C) Copyright Deti Fliegl 1999 |
7 | * (C) Copyright Randy Dunlap 2000 | 7 | * (C) Copyright Randy Dunlap 2000 |
8 | * (C) Copyright David Brownell 2000-2002 | 8 | * (C) Copyright David Brownell 2000-2002 |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify it | 10 | * This program is free software; you can redistribute it and/or modify it |
11 | * under the terms of the GNU General Public License as published by the | 11 | * under the terms of the GNU General Public License as published by the |
12 | * Free Software Foundation; either version 2 of the License, or (at your | 12 | * Free Software Foundation; either version 2 of the License, or (at your |
@@ -93,7 +93,7 @@ EXPORT_SYMBOL_GPL (usb_bus_list); | |||
93 | /* used when allocating bus numbers */ | 93 | /* used when allocating bus numbers */ |
94 | #define USB_MAXBUS 64 | 94 | #define USB_MAXBUS 64 |
95 | struct usb_busmap { | 95 | struct usb_busmap { |
96 | unsigned long busmap [USB_MAXBUS / (8*sizeof (unsigned long))]; | 96 | unsigned long busmap[USB_MAXBUS / (8*sizeof (unsigned long))]; |
97 | }; | 97 | }; |
98 | static struct usb_busmap busmap; | 98 | static struct usb_busmap busmap; |
99 | 99 | ||
@@ -171,7 +171,7 @@ static const u8 usb25_rh_dev_descriptor[18] = { | |||
171 | }; | 171 | }; |
172 | 172 | ||
173 | /* usb 2.0 root hub device descriptor */ | 173 | /* usb 2.0 root hub device descriptor */ |
174 | static const u8 usb2_rh_dev_descriptor [18] = { | 174 | static const u8 usb2_rh_dev_descriptor[18] = { |
175 | 0x12, /* __u8 bLength; */ | 175 | 0x12, /* __u8 bLength; */ |
176 | 0x01, /* __u8 bDescriptorType; Device */ | 176 | 0x01, /* __u8 bDescriptorType; Device */ |
177 | 0x00, 0x02, /* __le16 bcdUSB; v2.0 */ | 177 | 0x00, 0x02, /* __le16 bcdUSB; v2.0 */ |
@@ -194,7 +194,7 @@ static const u8 usb2_rh_dev_descriptor [18] = { | |||
194 | /* no usb 2.0 root hub "device qualifier" descriptor: one speed only */ | 194 | /* no usb 2.0 root hub "device qualifier" descriptor: one speed only */ |
195 | 195 | ||
196 | /* usb 1.1 root hub device descriptor */ | 196 | /* usb 1.1 root hub device descriptor */ |
197 | static const u8 usb11_rh_dev_descriptor [18] = { | 197 | static const u8 usb11_rh_dev_descriptor[18] = { |
198 | 0x12, /* __u8 bLength; */ | 198 | 0x12, /* __u8 bLength; */ |
199 | 0x01, /* __u8 bDescriptorType; Device */ | 199 | 0x01, /* __u8 bDescriptorType; Device */ |
200 | 0x10, 0x01, /* __le16 bcdUSB; v1.1 */ | 200 | 0x10, 0x01, /* __le16 bcdUSB; v1.1 */ |
@@ -219,7 +219,7 @@ static const u8 usb11_rh_dev_descriptor [18] = { | |||
219 | 219 | ||
220 | /* Configuration descriptors for our root hubs */ | 220 | /* Configuration descriptors for our root hubs */ |
221 | 221 | ||
222 | static const u8 fs_rh_config_descriptor [] = { | 222 | static const u8 fs_rh_config_descriptor[] = { |
223 | 223 | ||
224 | /* one configuration */ | 224 | /* one configuration */ |
225 | 0x09, /* __u8 bLength; */ | 225 | 0x09, /* __u8 bLength; */ |
@@ -228,13 +228,13 @@ static const u8 fs_rh_config_descriptor [] = { | |||
228 | 0x01, /* __u8 bNumInterfaces; (1) */ | 228 | 0x01, /* __u8 bNumInterfaces; (1) */ |
229 | 0x01, /* __u8 bConfigurationValue; */ | 229 | 0x01, /* __u8 bConfigurationValue; */ |
230 | 0x00, /* __u8 iConfiguration; */ | 230 | 0x00, /* __u8 iConfiguration; */ |
231 | 0xc0, /* __u8 bmAttributes; | 231 | 0xc0, /* __u8 bmAttributes; |
232 | Bit 7: must be set, | 232 | Bit 7: must be set, |
233 | 6: Self-powered, | 233 | 6: Self-powered, |
234 | 5: Remote wakeup, | 234 | 5: Remote wakeup, |
235 | 4..0: resvd */ | 235 | 4..0: resvd */ |
236 | 0x00, /* __u8 MaxPower; */ | 236 | 0x00, /* __u8 MaxPower; */ |
237 | 237 | ||
238 | /* USB 1.1: | 238 | /* USB 1.1: |
239 | * USB 2.0, single TT organization (mandatory): | 239 | * USB 2.0, single TT organization (mandatory): |
240 | * one interface, protocol 0 | 240 | * one interface, protocol 0 |
@@ -256,17 +256,17 @@ static const u8 fs_rh_config_descriptor [] = { | |||
256 | 0x00, /* __u8 if_bInterfaceSubClass; */ | 256 | 0x00, /* __u8 if_bInterfaceSubClass; */ |
257 | 0x00, /* __u8 if_bInterfaceProtocol; [usb1.1 or single tt] */ | 257 | 0x00, /* __u8 if_bInterfaceProtocol; [usb1.1 or single tt] */ |
258 | 0x00, /* __u8 if_iInterface; */ | 258 | 0x00, /* __u8 if_iInterface; */ |
259 | 259 | ||
260 | /* one endpoint (status change endpoint) */ | 260 | /* one endpoint (status change endpoint) */ |
261 | 0x07, /* __u8 ep_bLength; */ | 261 | 0x07, /* __u8 ep_bLength; */ |
262 | 0x05, /* __u8 ep_bDescriptorType; Endpoint */ | 262 | 0x05, /* __u8 ep_bDescriptorType; Endpoint */ |
263 | 0x81, /* __u8 ep_bEndpointAddress; IN Endpoint 1 */ | 263 | 0x81, /* __u8 ep_bEndpointAddress; IN Endpoint 1 */ |
264 | 0x03, /* __u8 ep_bmAttributes; Interrupt */ | 264 | 0x03, /* __u8 ep_bmAttributes; Interrupt */ |
265 | 0x02, 0x00, /* __le16 ep_wMaxPacketSize; 1 + (MAX_ROOT_PORTS / 8) */ | 265 | 0x02, 0x00, /* __le16 ep_wMaxPacketSize; 1 + (MAX_ROOT_PORTS / 8) */ |
266 | 0xff /* __u8 ep_bInterval; (255ms -- usb 2.0 spec) */ | 266 | 0xff /* __u8 ep_bInterval; (255ms -- usb 2.0 spec) */ |
267 | }; | 267 | }; |
268 | 268 | ||
269 | static const u8 hs_rh_config_descriptor [] = { | 269 | static const u8 hs_rh_config_descriptor[] = { |
270 | 270 | ||
271 | /* one configuration */ | 271 | /* one configuration */ |
272 | 0x09, /* __u8 bLength; */ | 272 | 0x09, /* __u8 bLength; */ |
@@ -275,13 +275,13 @@ static const u8 hs_rh_config_descriptor [] = { | |||
275 | 0x01, /* __u8 bNumInterfaces; (1) */ | 275 | 0x01, /* __u8 bNumInterfaces; (1) */ |
276 | 0x01, /* __u8 bConfigurationValue; */ | 276 | 0x01, /* __u8 bConfigurationValue; */ |
277 | 0x00, /* __u8 iConfiguration; */ | 277 | 0x00, /* __u8 iConfiguration; */ |
278 | 0xc0, /* __u8 bmAttributes; | 278 | 0xc0, /* __u8 bmAttributes; |
279 | Bit 7: must be set, | 279 | Bit 7: must be set, |
280 | 6: Self-powered, | 280 | 6: Self-powered, |
281 | 5: Remote wakeup, | 281 | 5: Remote wakeup, |
282 | 4..0: resvd */ | 282 | 4..0: resvd */ |
283 | 0x00, /* __u8 MaxPower; */ | 283 | 0x00, /* __u8 MaxPower; */ |
284 | 284 | ||
285 | /* USB 1.1: | 285 | /* USB 1.1: |
286 | * USB 2.0, single TT organization (mandatory): | 286 | * USB 2.0, single TT organization (mandatory): |
287 | * one interface, protocol 0 | 287 | * one interface, protocol 0 |
@@ -303,12 +303,12 @@ static const u8 hs_rh_config_descriptor [] = { | |||
303 | 0x00, /* __u8 if_bInterfaceSubClass; */ | 303 | 0x00, /* __u8 if_bInterfaceSubClass; */ |
304 | 0x00, /* __u8 if_bInterfaceProtocol; [usb1.1 or single tt] */ | 304 | 0x00, /* __u8 if_bInterfaceProtocol; [usb1.1 or single tt] */ |
305 | 0x00, /* __u8 if_iInterface; */ | 305 | 0x00, /* __u8 if_iInterface; */ |
306 | 306 | ||
307 | /* one endpoint (status change endpoint) */ | 307 | /* one endpoint (status change endpoint) */ |
308 | 0x07, /* __u8 ep_bLength; */ | 308 | 0x07, /* __u8 ep_bLength; */ |
309 | 0x05, /* __u8 ep_bDescriptorType; Endpoint */ | 309 | 0x05, /* __u8 ep_bDescriptorType; Endpoint */ |
310 | 0x81, /* __u8 ep_bEndpointAddress; IN Endpoint 1 */ | 310 | 0x81, /* __u8 ep_bEndpointAddress; IN Endpoint 1 */ |
311 | 0x03, /* __u8 ep_bmAttributes; Interrupt */ | 311 | 0x03, /* __u8 ep_bmAttributes; Interrupt */ |
312 | /* __le16 ep_wMaxPacketSize; 1 + (MAX_ROOT_PORTS / 8) | 312 | /* __le16 ep_wMaxPacketSize; 1 + (MAX_ROOT_PORTS / 8) |
313 | * see hub.c:hub_configure() for details. */ | 313 | * see hub.c:hub_configure() for details. */ |
314 | (USB_MAXCHILDREN + 1 + 7) / 8, 0x00, | 314 | (USB_MAXCHILDREN + 1 + 7) / 8, 0x00, |
@@ -464,7 +464,7 @@ rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len) | |||
464 | static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) | 464 | static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) |
465 | { | 465 | { |
466 | struct usb_ctrlrequest *cmd; | 466 | struct usb_ctrlrequest *cmd; |
467 | u16 typeReq, wValue, wIndex, wLength; | 467 | u16 typeReq, wValue, wIndex, wLength; |
468 | u8 *ubuf = urb->transfer_buffer; | 468 | u8 *ubuf = urb->transfer_buffer; |
469 | unsigned len = 0; | 469 | unsigned len = 0; |
470 | int status; | 470 | int status; |
@@ -526,10 +526,10 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) | |||
526 | */ | 526 | */ |
527 | 527 | ||
528 | case DeviceRequest | USB_REQ_GET_STATUS: | 528 | case DeviceRequest | USB_REQ_GET_STATUS: |
529 | tbuf [0] = (device_may_wakeup(&hcd->self.root_hub->dev) | 529 | tbuf[0] = (device_may_wakeup(&hcd->self.root_hub->dev) |
530 | << USB_DEVICE_REMOTE_WAKEUP) | 530 | << USB_DEVICE_REMOTE_WAKEUP) |
531 | | (1 << USB_DEVICE_SELF_POWERED); | 531 | | (1 << USB_DEVICE_SELF_POWERED); |
532 | tbuf [1] = 0; | 532 | tbuf[1] = 0; |
533 | len = 2; | 533 | len = 2; |
534 | break; | 534 | break; |
535 | case DeviceOutRequest | USB_REQ_CLEAR_FEATURE: | 535 | case DeviceOutRequest | USB_REQ_CLEAR_FEATURE: |
@@ -546,7 +546,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) | |||
546 | goto error; | 546 | goto error; |
547 | break; | 547 | break; |
548 | case DeviceRequest | USB_REQ_GET_CONFIGURATION: | 548 | case DeviceRequest | USB_REQ_GET_CONFIGURATION: |
549 | tbuf [0] = 1; | 549 | tbuf[0] = 1; |
550 | len = 1; | 550 | len = 1; |
551 | /* FALLTHROUGH */ | 551 | /* FALLTHROUGH */ |
552 | case DeviceOutRequest | USB_REQ_SET_CONFIGURATION: | 552 | case DeviceOutRequest | USB_REQ_SET_CONFIGURATION: |
@@ -609,7 +609,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) | |||
609 | } | 609 | } |
610 | break; | 610 | break; |
611 | case DeviceRequest | USB_REQ_GET_INTERFACE: | 611 | case DeviceRequest | USB_REQ_GET_INTERFACE: |
612 | tbuf [0] = 0; | 612 | tbuf[0] = 0; |
613 | len = 1; | 613 | len = 1; |
614 | /* FALLTHROUGH */ | 614 | /* FALLTHROUGH */ |
615 | case DeviceOutRequest | USB_REQ_SET_INTERFACE: | 615 | case DeviceOutRequest | USB_REQ_SET_INTERFACE: |
@@ -626,8 +626,8 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) | |||
626 | 626 | ||
627 | case EndpointRequest | USB_REQ_GET_STATUS: | 627 | case EndpointRequest | USB_REQ_GET_STATUS: |
628 | // ENDPOINT_HALT flag | 628 | // ENDPOINT_HALT flag |
629 | tbuf [0] = 0; | 629 | tbuf[0] = 0; |
630 | tbuf [1] = 0; | 630 | tbuf[1] = 0; |
631 | len = 2; | 631 | len = 2; |
632 | /* FALLTHROUGH */ | 632 | /* FALLTHROUGH */ |
633 | case EndpointOutRequest | USB_REQ_CLEAR_FEATURE: | 633 | case EndpointOutRequest | USB_REQ_CLEAR_FEATURE: |
@@ -877,7 +877,7 @@ static ssize_t authorized_default_store(struct device *dev, | |||
877 | usb_hcd = bus_to_hcd(usb_bus); | 877 | usb_hcd = bus_to_hcd(usb_bus); |
878 | result = sscanf(buf, "%u\n", &val); | 878 | result = sscanf(buf, "%u\n", &val); |
879 | if (result == 1) { | 879 | if (result == 1) { |
880 | usb_hcd->authorized_default = val? 1 : 0; | 880 | usb_hcd->authorized_default = val ? 1 : 0; |
881 | result = size; | 881 | result = size; |
882 | } | 882 | } |
883 | else | 883 | else |
@@ -1815,7 +1815,7 @@ rescan: | |||
1815 | case USB_ENDPOINT_XFER_INT: | 1815 | case USB_ENDPOINT_XFER_INT: |
1816 | s = "-intr"; break; | 1816 | s = "-intr"; break; |
1817 | default: | 1817 | default: |
1818 | s = "-iso"; break; | 1818 | s = "-iso"; break; |
1819 | }; | 1819 | }; |
1820 | s; | 1820 | s; |
1821 | })); | 1821 | })); |
@@ -2251,7 +2251,7 @@ static void hcd_resume_work(struct work_struct *work) | |||
2251 | } | 2251 | } |
2252 | 2252 | ||
2253 | /** | 2253 | /** |
2254 | * usb_hcd_resume_root_hub - called by HCD to resume its root hub | 2254 | * usb_hcd_resume_root_hub - called by HCD to resume its root hub |
2255 | * @hcd: host controller for this root hub | 2255 | * @hcd: host controller for this root hub |
2256 | * | 2256 | * |
2257 | * The USB host controller calls this function when its root hub is | 2257 | * The USB host controller calls this function when its root hub is |
@@ -2606,7 +2606,7 @@ int usb_add_hcd(struct usb_hcd *hcd, | |||
2606 | 2606 | ||
2607 | /* Keep old behaviour if authorized_default is not in [0, 1]. */ | 2607 | /* Keep old behaviour if authorized_default is not in [0, 1]. */ |
2608 | if (authorized_default < 0 || authorized_default > 1) | 2608 | if (authorized_default < 0 || authorized_default > 1) |
2609 | hcd->authorized_default = hcd->wireless? 0 : 1; | 2609 | hcd->authorized_default = hcd->wireless ? 0 : 1; |
2610 | else | 2610 | else |
2611 | hcd->authorized_default = authorized_default; | 2611 | hcd->authorized_default = authorized_default; |
2612 | set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); | 2612 | set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); |
@@ -2749,7 +2749,7 @@ err_allocate_root_hub: | |||
2749 | err_register_bus: | 2749 | err_register_bus: |
2750 | hcd_buffer_destroy(hcd); | 2750 | hcd_buffer_destroy(hcd); |
2751 | return retval; | 2751 | return retval; |
2752 | } | 2752 | } |
2753 | EXPORT_SYMBOL_GPL(usb_add_hcd); | 2753 | EXPORT_SYMBOL_GPL(usb_add_hcd); |
2754 | 2754 | ||
2755 | /** | 2755 | /** |
@@ -2846,7 +2846,7 @@ struct usb_mon_operations *mon_ops; | |||
2846 | * Notice that the code is minimally error-proof. Because usbmon needs | 2846 | * Notice that the code is minimally error-proof. Because usbmon needs |
2847 | * symbols from usbcore, usbcore gets referenced and cannot be unloaded first. | 2847 | * symbols from usbcore, usbcore gets referenced and cannot be unloaded first. |
2848 | */ | 2848 | */ |
2849 | 2849 | ||
2850 | int usb_mon_register (struct usb_mon_operations *ops) | 2850 | int usb_mon_register (struct usb_mon_operations *ops) |
2851 | { | 2851 | { |
2852 | 2852 | ||