aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-ohci.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-05-09 19:23:14 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-05-10 12:24:14 -0400
commit2d826cc5c791bdc5f5651324c485746be9492be0 (patch)
tree7c46ff209d06f1f8949aa2c3e10491594d10e203 /drivers/firewire/fw-ohci.c
parent213d7bbd76673fb1b26f1786af180bac07e57652 (diff)
firewire: Always use parens with sizeof.
Signed-off-by: Kristian Hoegsberg <krh@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-ohci.c')
-rw-r--r--drivers/firewire/fw-ohci.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 7d91b7e8f028..5833ce1b040b 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -255,7 +255,7 @@ static int ar_context_add_page(struct ar_context *ctx)
255 return -ENOMEM; 255 return -ENOMEM;
256 } 256 }
257 257
258 memset(&ab->descriptor, 0, sizeof ab->descriptor); 258 memset(&ab->descriptor, 0, sizeof(ab->descriptor));
259 ab->descriptor.control = cpu_to_le16(DESCRIPTOR_INPUT_MORE | 259 ab->descriptor.control = cpu_to_le16(DESCRIPTOR_INPUT_MORE |
260 DESCRIPTOR_STATUS | 260 DESCRIPTOR_STATUS |
261 DESCRIPTOR_BRANCH_ALWAYS); 261 DESCRIPTOR_BRANCH_ALWAYS);
@@ -440,7 +440,7 @@ static void context_tasklet(unsigned long data)
440 while (last->branch_address != 0) { 440 while (last->branch_address != 0) {
441 address = le32_to_cpu(last->branch_address); 441 address = le32_to_cpu(last->branch_address);
442 z = address & 0xf; 442 z = address & 0xf;
443 d = ctx->buffer + (address - ctx->buffer_bus) / sizeof *d; 443 d = ctx->buffer + (address - ctx->buffer_bus) / sizeof(*d);
444 last = (z == 2) ? d : d + z - 1; 444 last = (z == 2) ? d : d + z - 1;
445 445
446 if (!ctx->callback(ctx, d, last)) 446 if (!ctx->callback(ctx, d, last))
@@ -487,7 +487,7 @@ context_init(struct context *ctx, struct fw_ohci *ohci,
487 * element so that head == tail means buffer full. 487 * element so that head == tail means buffer full.
488 */ 488 */
489 489
490 memset(ctx->head_descriptor, 0, sizeof *ctx->head_descriptor); 490 memset(ctx->head_descriptor, 0, sizeof(*ctx->head_descriptor));
491 ctx->head_descriptor->control = cpu_to_le16(DESCRIPTOR_OUTPUT_LAST); 491 ctx->head_descriptor->control = cpu_to_le16(DESCRIPTOR_OUTPUT_LAST);
492 ctx->head_descriptor->transfer_status = cpu_to_le16(0x8011); 492 ctx->head_descriptor->transfer_status = cpu_to_le16(0x8011);
493 ctx->head_descriptor++; 493 ctx->head_descriptor++;
@@ -512,7 +512,7 @@ context_get_descriptors(struct context *ctx, int z, dma_addr_t *d_bus)
512 512
513 d = ctx->head_descriptor; 513 d = ctx->head_descriptor;
514 tail = ctx->tail_descriptor; 514 tail = ctx->tail_descriptor;
515 end = ctx->buffer + ctx->buffer_size / sizeof(struct descriptor); 515 end = ctx->buffer + ctx->buffer_size / sizeof(*d);
516 516
517 if (d + z <= tail) { 517 if (d + z <= tail) {
518 goto has_space; 518 goto has_space;
@@ -526,8 +526,8 @@ context_get_descriptors(struct context *ctx, int z, dma_addr_t *d_bus)
526 return NULL; 526 return NULL;
527 527
528 has_space: 528 has_space:
529 memset(d, 0, z * sizeof *d); 529 memset(d, 0, z * sizeof(*d));
530 *d_bus = ctx->buffer_bus + (d - ctx->buffer) * sizeof *d; 530 *d_bus = ctx->buffer_bus + (d - ctx->buffer) * sizeof(*d);
531 531
532 return d; 532 return d;
533} 533}
@@ -548,7 +548,7 @@ static void context_append(struct context *ctx,
548{ 548{
549 dma_addr_t d_bus; 549 dma_addr_t d_bus;
550 550
551 d_bus = ctx->buffer_bus + (d - ctx->buffer) * sizeof *d; 551 d_bus = ctx->buffer_bus + (d - ctx->buffer) * sizeof(*d);
552 552
553 ctx->head_descriptor = d + z + extra; 553 ctx->head_descriptor = d + z + extra;
554 ctx->prev_descriptor->branch_address = cpu_to_le32(d_bus | z); 554 ctx->prev_descriptor->branch_address = cpu_to_le32(d_bus | z);
@@ -820,7 +820,7 @@ handle_local_lock(struct fw_ohci *ohci, struct fw_packet *packet, u32 csr)
820 fw_notify("swap not done yet\n"); 820 fw_notify("swap not done yet\n");
821 821
822 fw_fill_response(&response, packet->header, 822 fw_fill_response(&response, packet->header,
823 RCODE_COMPLETE, &lock_old, sizeof lock_old); 823 RCODE_COMPLETE, &lock_old, sizeof(lock_old));
824 out: 824 out:
825 fw_core_handle_response(&ohci->card, &response); 825 fw_core_handle_response(&ohci->card, &response);
826} 826}
@@ -1376,7 +1376,7 @@ ohci_allocate_iso_context(struct fw_card *card, int type, size_t header_size)
1376 regs = OHCI1394_IsoRcvContextBase(index); 1376 regs = OHCI1394_IsoRcvContextBase(index);
1377 1377
1378 ctx = &list[index]; 1378 ctx = &list[index];
1379 memset(ctx, 0, sizeof *ctx); 1379 memset(ctx, 0, sizeof(*ctx));
1380 ctx->header_length = 0; 1380 ctx->header_length = 0;
1381 ctx->header = (void *) __get_free_page(GFP_KERNEL); 1381 ctx->header = (void *) __get_free_page(GFP_KERNEL);
1382 if (ctx->header == NULL) 1382 if (ctx->header == NULL)
@@ -1518,7 +1518,7 @@ ohci_queue_iso_transmit(struct fw_iso_context *base,
1518 z += payload_z; 1518 z += payload_z;
1519 1519
1520 /* Get header size in number of descriptors. */ 1520 /* Get header size in number of descriptors. */
1521 header_z = DIV_ROUND_UP(p->header_length, sizeof *d); 1521 header_z = DIV_ROUND_UP(p->header_length, sizeof(*d));
1522 1522
1523 d = context_get_descriptors(&ctx->context, z + header_z, &d_bus); 1523 d = context_get_descriptors(&ctx->context, z + header_z, &d_bus);
1524 if (d == NULL) 1524 if (d == NULL)
@@ -1541,7 +1541,7 @@ ohci_queue_iso_transmit(struct fw_iso_context *base,
1541 1541
1542 if (p->header_length > 0) { 1542 if (p->header_length > 0) {
1543 d[2].req_count = cpu_to_le16(p->header_length); 1543 d[2].req_count = cpu_to_le16(p->header_length);
1544 d[2].data_address = cpu_to_le32(d_bus + z * sizeof *d); 1544 d[2].data_address = cpu_to_le32(d_bus + z * sizeof(*d));
1545 memcpy(&d[z], p->header, p->header_length); 1545 memcpy(&d[z], p->header, p->header_length);
1546 } 1546 }
1547 1547
@@ -1620,7 +1620,7 @@ ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base,
1620 header_size = packet_count * (ctx->base.header_size + 4); 1620 header_size = packet_count * (ctx->base.header_size + 4);
1621 1621
1622 /* Get header size in number of descriptors. */ 1622 /* Get header size in number of descriptors. */
1623 header_z = DIV_ROUND_UP(header_size, sizeof *d); 1623 header_z = DIV_ROUND_UP(header_size, sizeof(*d));
1624 page = payload >> PAGE_SHIFT; 1624 page = payload >> PAGE_SHIFT;
1625 offset = payload & ~PAGE_MASK; 1625 offset = payload & ~PAGE_MASK;
1626 rest = p->payload_length; 1626 rest = p->payload_length;
@@ -1639,7 +1639,7 @@ ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base,
1639 db->first_size = cpu_to_le16(ctx->base.header_size + 4); 1639 db->first_size = cpu_to_le16(ctx->base.header_size + 4);
1640 db->first_req_count = cpu_to_le16(header_size); 1640 db->first_req_count = cpu_to_le16(header_size);
1641 db->first_res_count = db->first_req_count; 1641 db->first_res_count = db->first_req_count;
1642 db->first_buffer = cpu_to_le32(d_bus + sizeof *db); 1642 db->first_buffer = cpu_to_le32(d_bus + sizeof(*db));
1643 1643
1644 if (offset + rest < PAGE_SIZE) 1644 if (offset + rest < PAGE_SIZE)
1645 length = rest; 1645 length = rest;
@@ -1755,7 +1755,7 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
1755 int error_code; 1755 int error_code;
1756 size_t size; 1756 size_t size;
1757 1757
1758 ohci = kzalloc(sizeof *ohci, GFP_KERNEL); 1758 ohci = kzalloc(sizeof(*ohci), GFP_KERNEL);
1759 if (ohci == NULL) { 1759 if (ohci == NULL) {
1760 fw_error("Could not malloc fw_ohci data.\n"); 1760 fw_error("Could not malloc fw_ohci data.\n");
1761 return -ENOMEM; 1761 return -ENOMEM;