diff options
author | Oliver Neukum <oneukum@suse.de> | 2007-01-25 05:17:41 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-02-07 18:44:40 -0500 |
commit | 1a68f71d4fe71426a5c9703591e068241c03f896 (patch) | |
tree | 6a639df6b1003f67c5dc8d23e3e246816f29f111 /drivers/usb/core | |
parent | 9251644ab33579d80c038b077f78daa23a04fdcd (diff) |
USB: a bit more coding style cleanup
I was sitting in a train threatened to be blocked by ice. I took this
as a hint to do some more boring work for the common good. Here's
a bit more for coding style.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/buffer.c | 36 | ||||
-rw-r--r-- | drivers/usb/core/devices.c | 14 |
2 files changed, 25 insertions, 25 deletions
diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c index c3915dc28608..ead2475406b8 100644 --- a/drivers/usb/core/buffer.c +++ b/drivers/usb/core/buffer.c | |||
@@ -49,9 +49,9 @@ static const size_t pool_max [HCD_BUFFER_POOLS] = { | |||
49 | * | 49 | * |
50 | * Call hcd_buffer_destroy() to clean up after using those pools. | 50 | * Call hcd_buffer_destroy() to clean up after using those pools. |
51 | */ | 51 | */ |
52 | int hcd_buffer_create (struct usb_hcd *hcd) | 52 | int hcd_buffer_create(struct usb_hcd *hcd) |
53 | { | 53 | { |
54 | char name [16]; | 54 | char name[16]; |
55 | int i, size; | 55 | int i, size; |
56 | 56 | ||
57 | if (!hcd->self.controller->dma_mask) | 57 | if (!hcd->self.controller->dma_mask) |
@@ -60,11 +60,11 @@ int hcd_buffer_create (struct usb_hcd *hcd) | |||
60 | for (i = 0; i < HCD_BUFFER_POOLS; i++) { | 60 | for (i = 0; i < HCD_BUFFER_POOLS; i++) { |
61 | if (!(size = pool_max [i])) | 61 | if (!(size = pool_max [i])) |
62 | continue; | 62 | continue; |
63 | snprintf (name, sizeof name, "buffer-%d", size); | 63 | snprintf(name, sizeof name, "buffer-%d", size); |
64 | hcd->pool [i] = dma_pool_create (name, hcd->self.controller, | 64 | hcd->pool[i] = dma_pool_create(name, hcd->self.controller, |
65 | size, size, 0); | 65 | size, size, 0); |
66 | if (!hcd->pool [i]) { | 66 | if (!hcd->pool [i]) { |
67 | hcd_buffer_destroy (hcd); | 67 | hcd_buffer_destroy(hcd); |
68 | return -ENOMEM; | 68 | return -ENOMEM; |
69 | } | 69 | } |
70 | } | 70 | } |
@@ -79,14 +79,14 @@ int hcd_buffer_create (struct usb_hcd *hcd) | |||
79 | * | 79 | * |
80 | * This frees the buffer pools created by hcd_buffer_create(). | 80 | * This frees the buffer pools created by hcd_buffer_create(). |
81 | */ | 81 | */ |
82 | void hcd_buffer_destroy (struct usb_hcd *hcd) | 82 | void hcd_buffer_destroy(struct usb_hcd *hcd) |
83 | { | 83 | { |
84 | int i; | 84 | int i; |
85 | 85 | ||
86 | for (i = 0; i < HCD_BUFFER_POOLS; i++) { | 86 | for (i = 0; i < HCD_BUFFER_POOLS; i++) { |
87 | struct dma_pool *pool = hcd->pool [i]; | 87 | struct dma_pool *pool = hcd->pool[i]; |
88 | if (pool) { | 88 | if (pool) { |
89 | dma_pool_destroy (pool); | 89 | dma_pool_destroy(pool); |
90 | hcd->pool[i] = NULL; | 90 | hcd->pool[i] = NULL; |
91 | } | 91 | } |
92 | } | 92 | } |
@@ -97,8 +97,8 @@ void hcd_buffer_destroy (struct usb_hcd *hcd) | |||
97 | * better sharing and to leverage mm/slab.c intelligence. | 97 | * better sharing and to leverage mm/slab.c intelligence. |
98 | */ | 98 | */ |
99 | 99 | ||
100 | void *hcd_buffer_alloc ( | 100 | void *hcd_buffer_alloc( |
101 | struct usb_bus *bus, | 101 | struct usb_bus *bus, |
102 | size_t size, | 102 | size_t size, |
103 | gfp_t mem_flags, | 103 | gfp_t mem_flags, |
104 | dma_addr_t *dma | 104 | dma_addr_t *dma |
@@ -110,18 +110,18 @@ void *hcd_buffer_alloc ( | |||
110 | /* some USB hosts just use PIO */ | 110 | /* some USB hosts just use PIO */ |
111 | if (!bus->controller->dma_mask) { | 111 | if (!bus->controller->dma_mask) { |
112 | *dma = ~(dma_addr_t) 0; | 112 | *dma = ~(dma_addr_t) 0; |
113 | return kmalloc (size, mem_flags); | 113 | return kmalloc(size, mem_flags); |
114 | } | 114 | } |
115 | 115 | ||
116 | for (i = 0; i < HCD_BUFFER_POOLS; i++) { | 116 | for (i = 0; i < HCD_BUFFER_POOLS; i++) { |
117 | if (size <= pool_max [i]) | 117 | if (size <= pool_max [i]) |
118 | return dma_pool_alloc (hcd->pool [i], mem_flags, dma); | 118 | return dma_pool_alloc(hcd->pool [i], mem_flags, dma); |
119 | } | 119 | } |
120 | return dma_alloc_coherent (hcd->self.controller, size, dma, 0); | 120 | return dma_alloc_coherent(hcd->self.controller, size, dma, 0); |
121 | } | 121 | } |
122 | 122 | ||
123 | void hcd_buffer_free ( | 123 | void hcd_buffer_free( |
124 | struct usb_bus *bus, | 124 | struct usb_bus *bus, |
125 | size_t size, | 125 | size_t size, |
126 | void *addr, | 126 | void *addr, |
127 | dma_addr_t dma | 127 | dma_addr_t dma |
@@ -134,15 +134,15 @@ void hcd_buffer_free ( | |||
134 | return; | 134 | return; |
135 | 135 | ||
136 | if (!bus->controller->dma_mask) { | 136 | if (!bus->controller->dma_mask) { |
137 | kfree (addr); | 137 | kfree(addr); |
138 | return; | 138 | return; |
139 | } | 139 | } |
140 | 140 | ||
141 | for (i = 0; i < HCD_BUFFER_POOLS; i++) { | 141 | for (i = 0; i < HCD_BUFFER_POOLS; i++) { |
142 | if (size <= pool_max [i]) { | 142 | if (size <= pool_max [i]) { |
143 | dma_pool_free (hcd->pool [i], addr, dma); | 143 | dma_pool_free(hcd->pool [i], addr, dma); |
144 | return; | 144 | return; |
145 | } | 145 | } |
146 | } | 146 | } |
147 | dma_free_coherent (hcd->self.controller, size, addr, dma); | 147 | dma_free_coherent(hcd->self.controller, size, addr, dma); |
148 | } | 148 | } |
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c index 1ff429c37d52..a47c30b2d764 100644 --- a/drivers/usb/core/devices.c +++ b/drivers/usb/core/devices.c | |||
@@ -164,10 +164,10 @@ static const char *class_decode(const int class) | |||
164 | for (ix = 0; clas_info[ix].class != -1; ix++) | 164 | for (ix = 0; clas_info[ix].class != -1; ix++) |
165 | if (clas_info[ix].class == class) | 165 | if (clas_info[ix].class == class) |
166 | break; | 166 | break; |
167 | return (clas_info[ix].class_name); | 167 | return clas_info[ix].class_name; |
168 | } | 168 | } |
169 | 169 | ||
170 | static char *usb_dump_endpoint_descriptor ( | 170 | static char *usb_dump_endpoint_descriptor( |
171 | int speed, | 171 | int speed, |
172 | char *start, | 172 | char *start, |
173 | char *end, | 173 | char *end, |
@@ -212,9 +212,9 @@ static char *usb_dump_endpoint_descriptor ( | |||
212 | break; | 212 | break; |
213 | case USB_ENDPOINT_XFER_INT: | 213 | case USB_ENDPOINT_XFER_INT: |
214 | type = "Int."; | 214 | type = "Int."; |
215 | if (speed == USB_SPEED_HIGH) { | 215 | if (speed == USB_SPEED_HIGH) |
216 | interval = 1 << (desc->bInterval - 1); | 216 | interval = 1 << (desc->bInterval - 1); |
217 | } else | 217 | else |
218 | interval = desc->bInterval; | 218 | interval = desc->bInterval; |
219 | break; | 219 | break; |
220 | default: /* "can't happen" */ | 220 | default: /* "can't happen" */ |
@@ -347,7 +347,7 @@ static char *usb_dump_device_descriptor(char *start, char *end, const struct usb | |||
347 | 347 | ||
348 | if (start > end) | 348 | if (start > end) |
349 | return start; | 349 | return start; |
350 | start += sprintf (start, format_device1, | 350 | start += sprintf(start, format_device1, |
351 | bcdUSB >> 8, bcdUSB & 0xff, | 351 | bcdUSB >> 8, bcdUSB & 0xff, |
352 | desc->bDeviceClass, | 352 | desc->bDeviceClass, |
353 | class_decode (desc->bDeviceClass), | 353 | class_decode (desc->bDeviceClass), |
@@ -367,7 +367,7 @@ static char *usb_dump_device_descriptor(char *start, char *end, const struct usb | |||
367 | /* | 367 | /* |
368 | * Dump the different strings that this device holds. | 368 | * Dump the different strings that this device holds. |
369 | */ | 369 | */ |
370 | static char *usb_dump_device_strings (char *start, char *end, struct usb_device *dev) | 370 | static char *usb_dump_device_strings(char *start, char *end, struct usb_device *dev) |
371 | { | 371 | { |
372 | if (start > end) | 372 | if (start > end) |
373 | return start; | 373 | return start; |
@@ -399,7 +399,7 @@ static char *usb_dump_desc(char *start, char *end, struct usb_device *dev) | |||
399 | if (start > end) | 399 | if (start > end) |
400 | return start; | 400 | return start; |
401 | 401 | ||
402 | start = usb_dump_device_strings (start, end, dev); | 402 | start = usb_dump_device_strings(start, end, dev); |
403 | 403 | ||
404 | for (i = 0; i < dev->descriptor.bNumConfigurations; i++) { | 404 | for (i = 0; i < dev->descriptor.bNumConfigurations; i++) { |
405 | if (start > end) | 405 | if (start > end) |