aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-cdev.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-12-14 15:47:04 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-03-24 15:56:40 -0400
commit53dca51175cc2f66d21aeb1e70146cca65c53dad (patch)
treeda729da20cc4ca1cb994fa6659be7f23259f7097 /drivers/firewire/fw-cdev.c
parent2dbd7d7e2327b0c2cc4e2de903e1cfa19980a504 (diff)
firewire: remove line breaks before function names
type function_name(parameters); is nice to look at but was not used consistently. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-cdev.c')
-rw-r--r--drivers/firewire/fw-cdev.c88
1 files changed, 37 insertions, 51 deletions
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c
index 07c32a4bada2..3c075b2eedf9 100644
--- a/drivers/firewire/fw-cdev.c
+++ b/drivers/firewire/fw-cdev.c
@@ -96,14 +96,12 @@ struct client {
96 struct list_head link; 96 struct list_head link;
97}; 97};
98 98
99static inline void __user * 99static inline void __user *u64_to_uptr(__u64 value)
100u64_to_uptr(__u64 value)
101{ 100{
102 return (void __user *)(unsigned long)value; 101 return (void __user *)(unsigned long)value;
103} 102}
104 103
105static inline __u64 104static inline __u64 uptr_to_u64(void __user *ptr)
106uptr_to_u64(void __user *ptr)
107{ 105{
108 return (__u64)(unsigned long)ptr; 106 return (__u64)(unsigned long)ptr;
109} 107}
@@ -163,8 +161,8 @@ static void queue_event(struct client *client, struct event *event,
163 wake_up_interruptible(&client->wait); 161 wake_up_interruptible(&client->wait);
164} 162}
165 163
166static int 164static int dequeue_event(struct client *client,
167dequeue_event(struct client *client, char __user *buffer, size_t count) 165 char __user *buffer, size_t count)
168{ 166{
169 unsigned long flags; 167 unsigned long flags;
170 struct event *event; 168 struct event *event;
@@ -203,18 +201,16 @@ dequeue_event(struct client *client, char __user *buffer, size_t count)
203 return ret; 201 return ret;
204} 202}
205 203
206static ssize_t 204static ssize_t fw_device_op_read(struct file *file, char __user *buffer,
207fw_device_op_read(struct file *file, 205 size_t count, loff_t *offset)
208 char __user *buffer, size_t count, loff_t *offset)
209{ 206{
210 struct client *client = file->private_data; 207 struct client *client = file->private_data;
211 208
212 return dequeue_event(client, buffer, count); 209 return dequeue_event(client, buffer, count);
213} 210}
214 211
215static void 212static void fill_bus_reset_event(struct fw_cdev_event_bus_reset *event,
216fill_bus_reset_event(struct fw_cdev_event_bus_reset *event, 213 struct client *client)
217 struct client *client)
218{ 214{
219 struct fw_card *card = client->device->card; 215 struct fw_card *card = client->device->card;
220 unsigned long flags; 216 unsigned long flags;
@@ -233,9 +229,8 @@ fill_bus_reset_event(struct fw_cdev_event_bus_reset *event,
233 spin_unlock_irqrestore(&card->lock, flags); 229 spin_unlock_irqrestore(&card->lock, flags);
234} 230}
235 231
236static void 232static void for_each_client(struct fw_device *device,
237for_each_client(struct fw_device *device, 233 void (*callback)(struct client *client))
238 void (*callback)(struct client *client))
239{ 234{
240 struct client *c; 235 struct client *c;
241 236
@@ -245,8 +240,7 @@ for_each_client(struct fw_device *device,
245 mutex_unlock(&device->client_list_mutex); 240 mutex_unlock(&device->client_list_mutex);
246} 241}
247 242
248static void 243static void queue_bus_reset_event(struct client *client)
249queue_bus_reset_event(struct client *client)
250{ 244{
251 struct bus_reset *bus_reset; 245 struct bus_reset *bus_reset;
252 246
@@ -316,9 +310,8 @@ static int ioctl_get_info(struct client *client, void *buffer)
316 return 0; 310 return 0;
317} 311}
318 312
319static int 313static int add_client_resource(struct client *client,
320add_client_resource(struct client *client, struct client_resource *resource, 314 struct client_resource *resource, gfp_t gfp_mask)
321 gfp_t gfp_mask)
322{ 315{
323 unsigned long flags; 316 unsigned long flags;
324 int ret; 317 int ret;
@@ -341,10 +334,9 @@ add_client_resource(struct client *client, struct client_resource *resource,
341 return ret < 0 ? ret : 0; 334 return ret < 0 ? ret : 0;
342} 335}
343 336
344static int 337static int release_client_resource(struct client *client, u32 handle,
345release_client_resource(struct client *client, u32 handle, 338 client_resource_release_fn_t release,
346 client_resource_release_fn_t release, 339 struct client_resource **resource)
347 struct client_resource **resource)
348{ 340{
349 struct client_resource *r; 341 struct client_resource *r;
350 unsigned long flags; 342 unsigned long flags;
@@ -369,8 +361,8 @@ release_client_resource(struct client *client, u32 handle,
369 return 0; 361 return 0;
370} 362}
371 363
372static void 364static void release_transaction(struct client *client,
373release_transaction(struct client *client, struct client_resource *resource) 365 struct client_resource *resource)
374{ 366{
375 struct response *response = 367 struct response *response =
376 container_of(resource, struct response, resource); 368 container_of(resource, struct response, resource);
@@ -378,9 +370,8 @@ release_transaction(struct client *client, struct client_resource *resource)
378 fw_cancel_transaction(client->device->card, &response->transaction); 370 fw_cancel_transaction(client->device->card, &response->transaction);
379} 371}
380 372
381static void 373static void complete_transaction(struct fw_card *card, int rcode,
382complete_transaction(struct fw_card *card, int rcode, 374 void *payload, size_t length, void *data)
383 void *payload, size_t length, void *data)
384{ 375{
385 struct response *response = data; 376 struct response *response = data;
386 struct client *client = response->client; 377 struct client *client = response->client;
@@ -506,8 +497,8 @@ struct request_event {
506 struct fw_cdev_event_request request; 497 struct fw_cdev_event_request request;
507}; 498};
508 499
509static void 500static void release_request(struct client *client,
510release_request(struct client *client, struct client_resource *resource) 501 struct client_resource *resource)
511{ 502{
512 struct request *request = 503 struct request *request =
513 container_of(resource, struct request, resource); 504 container_of(resource, struct request, resource);
@@ -517,12 +508,11 @@ release_request(struct client *client, struct client_resource *resource)
517 kfree(request); 508 kfree(request);
518} 509}
519 510
520static void 511static void handle_request(struct fw_card *card, struct fw_request *r,
521handle_request(struct fw_card *card, struct fw_request *r, 512 int tcode, int destination, int source,
522 int tcode, int destination, int source, 513 int generation, int speed,
523 int generation, int speed, 514 unsigned long long offset,
524 unsigned long long offset, 515 void *payload, size_t length, void *callback_data)
525 void *payload, size_t length, void *callback_data)
526{ 516{
527 struct address_handler *handler = callback_data; 517 struct address_handler *handler = callback_data;
528 struct request *request; 518 struct request *request;
@@ -561,9 +551,8 @@ handle_request(struct fw_card *card, struct fw_request *r,
561 fw_send_response(card, r, RCODE_CONFLICT_ERROR); 551 fw_send_response(card, r, RCODE_CONFLICT_ERROR);
562} 552}
563 553
564static void 554static void release_address_handler(struct client *client,
565release_address_handler(struct client *client, 555 struct client_resource *resource)
566 struct client_resource *resource)
567{ 556{
568 struct address_handler *handler = 557 struct address_handler *handler =
569 container_of(resource, struct address_handler, resource); 558 container_of(resource, struct address_handler, resource);
@@ -716,9 +705,8 @@ static int ioctl_remove_descriptor(struct client *client, void *buffer)
716 release_descriptor, NULL); 705 release_descriptor, NULL);
717} 706}
718 707
719static void 708static void iso_callback(struct fw_iso_context *context, u32 cycle,
720iso_callback(struct fw_iso_context *context, u32 cycle, 709 size_t header_length, void *header, void *data)
721 size_t header_length, void *header, void *data)
722{ 710{
723 struct client *client = data; 711 struct client *client = data;
724 struct iso_interrupt *irq; 712 struct iso_interrupt *irq;
@@ -954,8 +942,8 @@ static int (* const ioctl_handlers[])(struct client *client, void *buffer) = {
954 ioctl_get_cycle_timer, 942 ioctl_get_cycle_timer,
955}; 943};
956 944
957static int 945static int dispatch_ioctl(struct client *client,
958dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg) 946 unsigned int cmd, void __user *arg)
959{ 947{
960 char buffer[256]; 948 char buffer[256];
961 int ret; 949 int ret;
@@ -983,9 +971,8 @@ dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
983 return ret; 971 return ret;
984} 972}
985 973
986static long 974static long fw_device_op_ioctl(struct file *file,
987fw_device_op_ioctl(struct file *file, 975 unsigned int cmd, unsigned long arg)
988 unsigned int cmd, unsigned long arg)
989{ 976{
990 struct client *client = file->private_data; 977 struct client *client = file->private_data;
991 978
@@ -996,9 +983,8 @@ fw_device_op_ioctl(struct file *file,
996} 983}
997 984
998#ifdef CONFIG_COMPAT 985#ifdef CONFIG_COMPAT
999static long 986static long fw_device_op_compat_ioctl(struct file *file,
1000fw_device_op_compat_ioctl(struct file *file, 987 unsigned int cmd, unsigned long arg)
1001 unsigned int cmd, unsigned long arg)
1002{ 988{
1003 struct client *client = file->private_data; 989 struct client *client = file->private_data;
1004 990