aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-sbp2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/fw-sbp2.c')
-rw-r--r--drivers/firewire/fw-sbp2.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index e2ffbc87dcfe..68300414e5f4 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -279,7 +279,7 @@ sbp2_status_write(struct fw_card *card, struct fw_request *request,
279 unsigned long flags; 279 unsigned long flags;
280 280
281 if (tcode != TCODE_WRITE_BLOCK_REQUEST || 281 if (tcode != TCODE_WRITE_BLOCK_REQUEST ||
282 length == 0 || length > sizeof status) { 282 length == 0 || length > sizeof(status)) {
283 fw_send_response(card, request, RCODE_TYPE_ERROR); 283 fw_send_response(card, request, RCODE_TYPE_ERROR);
284 return; 284 return;
285 } 285 }
@@ -340,7 +340,7 @@ sbp2_send_orb(struct sbp2_orb *orb, struct fw_unit *unit,
340 340
341 orb->pointer.high = 0; 341 orb->pointer.high = 0;
342 orb->pointer.low = orb->request_bus; 342 orb->pointer.low = orb->request_bus;
343 fw_memcpy_to_be32(&orb->pointer, &orb->pointer, sizeof orb->pointer); 343 fw_memcpy_to_be32(&orb->pointer, &orb->pointer, sizeof(orb->pointer));
344 344
345 spin_lock_irqsave(&device->card->lock, flags); 345 spin_lock_irqsave(&device->card->lock, flags);
346 list_add_tail(&orb->link, &sd->orb_list); 346 list_add_tail(&orb->link, &sd->orb_list);
@@ -349,7 +349,7 @@ sbp2_send_orb(struct sbp2_orb *orb, struct fw_unit *unit,
349 fw_send_request(device->card, &orb->t, TCODE_WRITE_BLOCK_REQUEST, 349 fw_send_request(device->card, &orb->t, TCODE_WRITE_BLOCK_REQUEST,
350 node_id, generation, 350 node_id, generation,
351 device->node->max_speed, offset, 351 device->node->max_speed, offset,
352 &orb->pointer, sizeof orb->pointer, 352 &orb->pointer, sizeof(orb->pointer),
353 complete_transaction, orb); 353 complete_transaction, orb);
354} 354}
355 355
@@ -386,7 +386,7 @@ complete_management_orb(struct sbp2_orb *base_orb, struct sbp2_status *status)
386 (struct sbp2_management_orb *)base_orb; 386 (struct sbp2_management_orb *)base_orb;
387 387
388 if (status) 388 if (status)
389 memcpy(&orb->status, status, sizeof *status); 389 memcpy(&orb->status, status, sizeof(*status));
390 complete(&orb->done); 390 complete(&orb->done);
391} 391}
392 392
@@ -399,7 +399,7 @@ sbp2_send_management_orb(struct fw_unit *unit, int node_id, int generation,
399 struct sbp2_management_orb *orb; 399 struct sbp2_management_orb *orb;
400 int retval = -ENOMEM; 400 int retval = -ENOMEM;
401 401
402 orb = kzalloc(sizeof *orb, GFP_ATOMIC); 402 orb = kzalloc(sizeof(*orb), GFP_ATOMIC);
403 if (orb == NULL) 403 if (orb == NULL)
404 return -ENOMEM; 404 return -ENOMEM;
405 405
@@ -409,13 +409,13 @@ sbp2_send_management_orb(struct fw_unit *unit, int node_id, int generation,
409 */ 409 */
410 orb->base.request_bus = 410 orb->base.request_bus =
411 dma_map_single(device->card->device, &orb->request, 411 dma_map_single(device->card->device, &orb->request,
412 sizeof orb->request, DMA_TO_DEVICE); 412 sizeof(orb->request), DMA_TO_DEVICE);
413 if (dma_mapping_error(orb->base.request_bus)) 413 if (dma_mapping_error(orb->base.request_bus))
414 goto out; 414 goto out;
415 415
416 orb->response_bus = 416 orb->response_bus =
417 dma_map_single(device->card->device, &orb->response, 417 dma_map_single(device->card->device, &orb->response,
418 sizeof orb->response, DMA_FROM_DEVICE); 418 sizeof(orb->response), DMA_FROM_DEVICE);
419 if (dma_mapping_error(orb->response_bus)) 419 if (dma_mapping_error(orb->response_bus))
420 goto out; 420 goto out;
421 421
@@ -427,7 +427,7 @@ sbp2_send_management_orb(struct fw_unit *unit, int node_id, int generation,
427 MANAGEMENT_ORB_FUNCTION(function) | 427 MANAGEMENT_ORB_FUNCTION(function) |
428 MANAGEMENT_ORB_LUN(lun); 428 MANAGEMENT_ORB_LUN(lun);
429 orb->request.length = 429 orb->request.length =
430 MANAGEMENT_ORB_RESPONSE_LENGTH(sizeof orb->response); 430 MANAGEMENT_ORB_RESPONSE_LENGTH(sizeof(orb->response));
431 431
432 orb->request.status_fifo.high = sd->address_handler.offset >> 32; 432 orb->request.status_fifo.high = sd->address_handler.offset >> 32;
433 orb->request.status_fifo.low = sd->address_handler.offset; 433 orb->request.status_fifo.low = sd->address_handler.offset;
@@ -443,7 +443,7 @@ sbp2_send_management_orb(struct fw_unit *unit, int node_id, int generation,
443 MANAGEMENT_ORB_RECONNECT(0); 443 MANAGEMENT_ORB_RECONNECT(0);
444 } 444 }
445 445
446 fw_memcpy_to_be32(&orb->request, &orb->request, sizeof orb->request); 446 fw_memcpy_to_be32(&orb->request, &orb->request, sizeof(orb->request));
447 447
448 init_completion(&orb->done); 448 init_completion(&orb->done);
449 orb->base.callback = complete_management_orb; 449 orb->base.callback = complete_management_orb;
@@ -478,13 +478,13 @@ sbp2_send_management_orb(struct fw_unit *unit, int node_id, int generation,
478 retval = 0; 478 retval = 0;
479 out: 479 out:
480 dma_unmap_single(device->card->device, orb->base.request_bus, 480 dma_unmap_single(device->card->device, orb->base.request_bus,
481 sizeof orb->request, DMA_TO_DEVICE); 481 sizeof(orb->request), DMA_TO_DEVICE);
482 dma_unmap_single(device->card->device, orb->response_bus, 482 dma_unmap_single(device->card->device, orb->response_bus,
483 sizeof orb->response, DMA_FROM_DEVICE); 483 sizeof(orb->response), DMA_FROM_DEVICE);
484 484
485 if (response) 485 if (response)
486 fw_memcpy_from_be32(response, 486 fw_memcpy_from_be32(response,
487 orb->response, sizeof orb->response); 487 orb->response, sizeof(orb->response));
488 kfree(orb); 488 kfree(orb);
489 489
490 return retval; 490 return retval;
@@ -506,14 +506,14 @@ static int sbp2_agent_reset(struct fw_unit *unit)
506 struct fw_transaction *t; 506 struct fw_transaction *t;
507 static u32 zero; 507 static u32 zero;
508 508
509 t = kzalloc(sizeof *t, GFP_ATOMIC); 509 t = kzalloc(sizeof(*t), GFP_ATOMIC);
510 if (t == NULL) 510 if (t == NULL)
511 return -ENOMEM; 511 return -ENOMEM;
512 512
513 fw_send_request(device->card, t, TCODE_WRITE_QUADLET_REQUEST, 513 fw_send_request(device->card, t, TCODE_WRITE_QUADLET_REQUEST,
514 sd->node_id, sd->generation, SCODE_400, 514 sd->node_id, sd->generation, SCODE_400,
515 sd->command_block_agent_address + SBP2_AGENT_RESET, 515 sd->command_block_agent_address + SBP2_AGENT_RESET,
516 &zero, sizeof zero, complete_agent_reset_write, t); 516 &zero, sizeof(zero), complete_agent_reset_write, t);
517 517
518 return 0; 518 return 0;
519} 519}
@@ -870,7 +870,7 @@ complete_command_orb(struct sbp2_orb *base_orb, struct sbp2_status *status)
870 } 870 }
871 871
872 dma_unmap_single(device->card->device, orb->base.request_bus, 872 dma_unmap_single(device->card->device, orb->base.request_bus,
873 sizeof orb->request, DMA_TO_DEVICE); 873 sizeof(orb->request), DMA_TO_DEVICE);
874 874
875 if (orb->cmd->use_sg > 0) { 875 if (orb->cmd->use_sg > 0) {
876 sg = (struct scatterlist *)orb->cmd->request_buffer; 876 sg = (struct scatterlist *)orb->cmd->request_buffer;
@@ -880,11 +880,11 @@ complete_command_orb(struct sbp2_orb *base_orb, struct sbp2_status *status)
880 880
881 if (orb->page_table_bus != 0) 881 if (orb->page_table_bus != 0)
882 dma_unmap_single(device->card->device, orb->page_table_bus, 882 dma_unmap_single(device->card->device, orb->page_table_bus,
883 sizeof orb->page_table_bus, DMA_TO_DEVICE); 883 sizeof(orb->page_table_bus), DMA_TO_DEVICE);
884 884
885 if (orb->request_buffer_bus != 0) 885 if (orb->request_buffer_bus != 0)
886 dma_unmap_single(device->card->device, orb->request_buffer_bus, 886 dma_unmap_single(device->card->device, orb->request_buffer_bus,
887 sizeof orb->request_buffer_bus, 887 sizeof(orb->request_buffer_bus),
888 DMA_FROM_DEVICE); 888 DMA_FROM_DEVICE);
889 889
890 orb->cmd->result = result; 890 orb->cmd->result = result;
@@ -944,7 +944,7 @@ static int sbp2_command_orb_map_scatterlist(struct sbp2_command_orb *orb)
944 } 944 }
945 } 945 }
946 946
947 size = sizeof orb->page_table[0] * j; 947 size = sizeof(orb->page_table[0]) * j;
948 948
949 /* 949 /*
950 * The data_descriptor pointer is the one case where we need 950 * The data_descriptor pointer is the one case where we need
@@ -997,7 +997,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
997 return 0; 997 return 0;
998 } 998 }
999 999
1000 orb = kzalloc(sizeof *orb, GFP_ATOMIC); 1000 orb = kzalloc(sizeof(*orb), GFP_ATOMIC);
1001 if (orb == NULL) { 1001 if (orb == NULL) {
1002 fw_notify("failed to alloc orb\n"); 1002 fw_notify("failed to alloc orb\n");
1003 goto fail_alloc; 1003 goto fail_alloc;
@@ -1007,7 +1007,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
1007 orb->base.rcode = -1; 1007 orb->base.rcode = -1;
1008 orb->base.request_bus = 1008 orb->base.request_bus =
1009 dma_map_single(device->card->device, &orb->request, 1009 dma_map_single(device->card->device, &orb->request,
1010 sizeof orb->request, DMA_TO_DEVICE); 1010 sizeof(orb->request), DMA_TO_DEVICE);
1011 if (dma_mapping_error(orb->base.request_bus)) 1011 if (dma_mapping_error(orb->base.request_bus))
1012 goto fail_mapping; 1012 goto fail_mapping;
1013 1013
@@ -1038,10 +1038,10 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
1038 if (cmd->use_sg && sbp2_command_orb_map_scatterlist(orb) < 0) 1038 if (cmd->use_sg && sbp2_command_orb_map_scatterlist(orb) < 0)
1039 goto fail_map_payload; 1039 goto fail_map_payload;
1040 1040
1041 fw_memcpy_to_be32(&orb->request, &orb->request, sizeof orb->request); 1041 fw_memcpy_to_be32(&orb->request, &orb->request, sizeof(orb->request));
1042 1042
1043 memset(orb->request.command_block, 1043 memset(orb->request.command_block,
1044 0, sizeof orb->request.command_block); 1044 0, sizeof(orb->request.command_block));
1045 memcpy(orb->request.command_block, cmd->cmnd, COMMAND_SIZE(*cmd->cmnd)); 1045 memcpy(orb->request.command_block, cmd->cmnd, COMMAND_SIZE(*cmd->cmnd));
1046 1046
1047 orb->base.callback = complete_command_orb; 1047 orb->base.callback = complete_command_orb;
@@ -1053,7 +1053,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
1053 1053
1054 fail_map_payload: 1054 fail_map_payload:
1055 dma_unmap_single(device->card->device, orb->base.request_bus, 1055 dma_unmap_single(device->card->device, orb->base.request_bus,
1056 sizeof orb->request, DMA_TO_DEVICE); 1056 sizeof(orb->request), DMA_TO_DEVICE);
1057 fail_mapping: 1057 fail_mapping:
1058 kfree(orb); 1058 kfree(orb);
1059 fail_alloc: 1059 fail_alloc: