aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-cdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/fw-cdev.c')
-rw-r--r--drivers/firewire/fw-cdev.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c
index c876ac3c50e0..0fa5bd54c6a1 100644
--- a/drivers/firewire/fw-cdev.c
+++ b/drivers/firewire/fw-cdev.c
@@ -110,7 +110,7 @@ static int fw_device_op_open(struct inode *inode, struct file *file)
110 if (device == NULL) 110 if (device == NULL)
111 return -ENODEV; 111 return -ENODEV;
112 112
113 client = kzalloc(sizeof *client, GFP_KERNEL); 113 client = kzalloc(sizeof(*client), GFP_KERNEL);
114 if (client == NULL) 114 if (client == NULL)
115 return -ENOMEM; 115 return -ENOMEM;
116 116
@@ -233,7 +233,7 @@ queue_bus_reset_event(struct client *client)
233{ 233{
234 struct bus_reset *bus_reset; 234 struct bus_reset *bus_reset;
235 235
236 bus_reset = kzalloc(sizeof *bus_reset, GFP_ATOMIC); 236 bus_reset = kzalloc(sizeof(*bus_reset), GFP_ATOMIC);
237 if (bus_reset == NULL) { 237 if (bus_reset == NULL) {
238 fw_notify("Out of memory when allocating bus reset event\n"); 238 fw_notify("Out of memory when allocating bus reset event\n");
239 return; 239 return;
@@ -242,7 +242,7 @@ queue_bus_reset_event(struct client *client)
242 fill_bus_reset_event(&bus_reset->reset, client); 242 fill_bus_reset_event(&bus_reset->reset, client);
243 243
244 queue_event(client, &bus_reset->event, 244 queue_event(client, &bus_reset->event,
245 &bus_reset->reset, sizeof bus_reset->reset, NULL, 0); 245 &bus_reset->reset, sizeof(bus_reset->reset), NULL, 0);
246} 246}
247 247
248void fw_device_cdev_update(struct fw_device *device) 248void fw_device_cdev_update(struct fw_device *device)
@@ -284,7 +284,7 @@ static int ioctl_get_info(struct client *client, void *buffer)
284 void __user *uptr = u64_to_uptr(get_info->bus_reset); 284 void __user *uptr = u64_to_uptr(get_info->bus_reset);
285 285
286 fill_bus_reset_event(&bus_reset, client); 286 fill_bus_reset_event(&bus_reset, client);
287 if (copy_to_user(uptr, &bus_reset, sizeof bus_reset)) 287 if (copy_to_user(uptr, &bus_reset, sizeof(bus_reset)))
288 return -EFAULT; 288 return -EFAULT;
289 } 289 }
290 290
@@ -361,7 +361,7 @@ complete_transaction(struct fw_card *card, int rcode,
361 response->response.type = FW_CDEV_EVENT_RESPONSE; 361 response->response.type = FW_CDEV_EVENT_RESPONSE;
362 response->response.rcode = rcode; 362 response->response.rcode = rcode;
363 queue_event(client, &response->event, 363 queue_event(client, &response->event,
364 &response->response, sizeof response->response, 364 &response->response, sizeof(response->response),
365 response->response.data, response->response.length); 365 response->response.data, response->response.length);
366} 366}
367 367
@@ -375,7 +375,7 @@ static ssize_t ioctl_send_request(struct client *client, void *buffer)
375 if (request->length > 4096) 375 if (request->length > 4096)
376 return -EINVAL; 376 return -EINVAL;
377 377
378 response = kmalloc(sizeof *response + request->length, GFP_KERNEL); 378 response = kmalloc(sizeof(*response) + request->length, GFP_KERNEL);
379 if (response == NULL) 379 if (response == NULL)
380 return -ENOMEM; 380 return -ENOMEM;
381 381
@@ -403,9 +403,9 @@ static ssize_t ioctl_send_request(struct client *client, void *buffer)
403 complete_transaction, response); 403 complete_transaction, response);
404 404
405 if (request->data) 405 if (request->data)
406 return sizeof request + request->length; 406 return sizeof(request) + request->length;
407 else 407 else
408 return sizeof request; 408 return sizeof(request);
409} 409}
410 410
411struct address_handler { 411struct address_handler {
@@ -450,8 +450,8 @@ handle_request(struct fw_card *card, struct fw_request *r,
450 struct request_event *e; 450 struct request_event *e;
451 struct client *client = handler->client; 451 struct client *client = handler->client;
452 452
453 request = kmalloc(sizeof *request, GFP_ATOMIC); 453 request = kmalloc(sizeof(*request), GFP_ATOMIC);
454 e = kmalloc(sizeof *e, GFP_ATOMIC); 454 e = kmalloc(sizeof(*e), GFP_ATOMIC);
455 if (request == NULL || e == NULL) { 455 if (request == NULL || e == NULL) {
456 kfree(request); 456 kfree(request);
457 kfree(e); 457 kfree(e);
@@ -474,7 +474,7 @@ handle_request(struct fw_card *card, struct fw_request *r,
474 e->request.closure = handler->closure; 474 e->request.closure = handler->closure;
475 475
476 queue_event(client, &e->event, 476 queue_event(client, &e->event,
477 &e->request, sizeof e->request, payload, length); 477 &e->request, sizeof(e->request), payload, length);
478} 478}
479 479
480static void 480static void
@@ -494,7 +494,7 @@ static int ioctl_allocate(struct client *client, void *buffer)
494 struct address_handler *handler; 494 struct address_handler *handler;
495 struct fw_address_region region; 495 struct fw_address_region region;
496 496
497 handler = kmalloc(sizeof *handler, GFP_KERNEL); 497 handler = kmalloc(sizeof(*handler), GFP_KERNEL);
498 if (handler == NULL) 498 if (handler == NULL)
499 return -ENOMEM; 499 return -ENOMEM;
500 500
@@ -581,7 +581,7 @@ static int ioctl_add_descriptor(struct client *client, void *buffer)
581 return -EINVAL; 581 return -EINVAL;
582 582
583 descriptor = 583 descriptor =
584 kmalloc(sizeof *descriptor + request->length * 4, GFP_KERNEL); 584 kmalloc(sizeof(*descriptor) + request->length * 4, GFP_KERNEL);
585 if (descriptor == NULL) 585 if (descriptor == NULL)
586 return -ENOMEM; 586 return -ENOMEM;
587 587
@@ -623,7 +623,7 @@ iso_callback(struct fw_iso_context *context, u32 cycle,
623 struct client *client = data; 623 struct client *client = data;
624 struct iso_interrupt *interrupt; 624 struct iso_interrupt *interrupt;
625 625
626 interrupt = kzalloc(sizeof *interrupt + header_length, GFP_ATOMIC); 626 interrupt = kzalloc(sizeof(*interrupt) + header_length, GFP_ATOMIC);
627 if (interrupt == NULL) 627 if (interrupt == NULL)
628 return; 628 return;
629 629
@@ -634,7 +634,7 @@ iso_callback(struct fw_iso_context *context, u32 cycle,
634 memcpy(interrupt->interrupt.header, header, header_length); 634 memcpy(interrupt->interrupt.header, header, header_length);
635 queue_event(client, &interrupt->event, 635 queue_event(client, &interrupt->event,
636 &interrupt->interrupt, 636 &interrupt->interrupt,
637 sizeof interrupt->interrupt + header_length, NULL, 0); 637 sizeof(interrupt->interrupt) + header_length, NULL, 0);
638} 638}
639 639
640static int ioctl_create_iso_context(struct client *client, void *buffer) 640static int ioctl_create_iso_context(struct client *client, void *buffer)
@@ -717,7 +717,7 @@ static int ioctl_queue_iso(struct client *client, void *buffer)
717 end = (void __user *)p + request->size; 717 end = (void __user *)p + request->size;
718 count = 0; 718 count = 0;
719 while (p < end) { 719 while (p < end) {
720 if (__copy_from_user(&u.packet, p, sizeof *p)) 720 if (__copy_from_user(&u.packet, p, sizeof(*p)))
721 return -EFAULT; 721 return -EFAULT;
722 722
723 if (ctx->type == FW_ISO_CONTEXT_TRANSMIT) { 723 if (ctx->type == FW_ISO_CONTEXT_TRANSMIT) {
@@ -819,7 +819,7 @@ dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
819 return -EINVAL; 819 return -EINVAL;
820 820
821 if (_IOC_DIR(cmd) & _IOC_WRITE) { 821 if (_IOC_DIR(cmd) & _IOC_WRITE) {
822 if (_IOC_SIZE(cmd) > sizeof buffer || 822 if (_IOC_SIZE(cmd) > sizeof(buffer) ||
823 copy_from_user(buffer, arg, _IOC_SIZE(cmd))) 823 copy_from_user(buffer, arg, _IOC_SIZE(cmd)))
824 return -EFAULT; 824 return -EFAULT;
825 } 825 }
@@ -829,7 +829,7 @@ dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
829 return retval; 829 return retval;
830 830
831 if (_IOC_DIR(cmd) & _IOC_READ) { 831 if (_IOC_DIR(cmd) & _IOC_READ) {
832 if (_IOC_SIZE(cmd) > sizeof buffer || 832 if (_IOC_SIZE(cmd) > sizeof(buffer) ||
833 copy_to_user(arg, buffer, _IOC_SIZE(cmd))) 833 copy_to_user(arg, buffer, _IOC_SIZE(cmd)))
834 return -EFAULT; 834 return -EFAULT;
835 } 835 }