Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 55810
b: refs/heads/master
c: 2d826cc
h: refs/heads/master
v: v3
  • Loading branch information
Kristian Høgsberg authored and Stefan Richter committed May 10, 2007
1 parent 9e9e241 commit 08e3d81
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 66 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 213d7bbd76673fb1b26f1786af180bac07e57652
refs/heads/master: 2d826cc5c791bdc5f5651324c485746be9492be0
4 changes: 2 additions & 2 deletions trunk/drivers/firewire/fw-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ generate_config_rom(struct fw_card *card, size_t *config_rom_length)
* the version stored in the OHCI registers.
*/

memset(config_rom, 0, sizeof config_rom);
memset(config_rom, 0, sizeof(config_rom));
config_rom[0] = BIB_CRC_LENGTH(4) | BIB_INFO_LENGTH(4) | BIB_CRC(0);
config_rom[1] = 0x31333934;

Expand Down Expand Up @@ -258,7 +258,7 @@ fw_card_bm_work(struct work_struct *work)
fw_send_request(card, &bmd.t, TCODE_LOCK_COMPARE_SWAP,
irm_id, generation,
SCODE_100, CSR_REGISTER_BASE + CSR_BUS_MANAGER_ID,
&bmd.lock, sizeof bmd.lock,
&bmd.lock, sizeof(bmd.lock),
complete_bm_lock, &bmd);
wait_for_completion(&bmd.done);

Expand Down
36 changes: 18 additions & 18 deletions trunk/drivers/firewire/fw-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static int fw_device_op_open(struct inode *inode, struct file *file)
if (device == NULL)
return -ENODEV;

client = kzalloc(sizeof *client, GFP_KERNEL);
client = kzalloc(sizeof(*client), GFP_KERNEL);
if (client == NULL)
return -ENOMEM;

Expand Down Expand Up @@ -233,7 +233,7 @@ queue_bus_reset_event(struct client *client)
{
struct bus_reset *bus_reset;

bus_reset = kzalloc(sizeof *bus_reset, GFP_ATOMIC);
bus_reset = kzalloc(sizeof(*bus_reset), GFP_ATOMIC);
if (bus_reset == NULL) {
fw_notify("Out of memory when allocating bus reset event\n");
return;
Expand All @@ -242,7 +242,7 @@ queue_bus_reset_event(struct client *client)
fill_bus_reset_event(&bus_reset->reset, client);

queue_event(client, &bus_reset->event,
&bus_reset->reset, sizeof bus_reset->reset, NULL, 0);
&bus_reset->reset, sizeof(bus_reset->reset), NULL, 0);
}

void fw_device_cdev_update(struct fw_device *device)
Expand Down Expand Up @@ -284,7 +284,7 @@ static int ioctl_get_info(struct client *client, void *buffer)
void __user *uptr = u64_to_uptr(get_info->bus_reset);

fill_bus_reset_event(&bus_reset, client);
if (copy_to_user(uptr, &bus_reset, sizeof bus_reset))
if (copy_to_user(uptr, &bus_reset, sizeof(bus_reset)))
return -EFAULT;
}

Expand Down Expand Up @@ -361,7 +361,7 @@ complete_transaction(struct fw_card *card, int rcode,
response->response.type = FW_CDEV_EVENT_RESPONSE;
response->response.rcode = rcode;
queue_event(client, &response->event,
&response->response, sizeof response->response,
&response->response, sizeof(response->response),
response->response.data, response->response.length);
}

Expand All @@ -375,7 +375,7 @@ static ssize_t ioctl_send_request(struct client *client, void *buffer)
if (request->length > 4096)
return -EINVAL;

response = kmalloc(sizeof *response + request->length, GFP_KERNEL);
response = kmalloc(sizeof(*response) + request->length, GFP_KERNEL);
if (response == NULL)
return -ENOMEM;

Expand Down Expand Up @@ -403,9 +403,9 @@ static ssize_t ioctl_send_request(struct client *client, void *buffer)
complete_transaction, response);

if (request->data)
return sizeof request + request->length;
return sizeof(request) + request->length;
else
return sizeof request;
return sizeof(request);
}

struct address_handler {
Expand Down Expand Up @@ -450,8 +450,8 @@ handle_request(struct fw_card *card, struct fw_request *r,
struct request_event *e;
struct client *client = handler->client;

request = kmalloc(sizeof *request, GFP_ATOMIC);
e = kmalloc(sizeof *e, GFP_ATOMIC);
request = kmalloc(sizeof(*request), GFP_ATOMIC);
e = kmalloc(sizeof(*e), GFP_ATOMIC);
if (request == NULL || e == NULL) {
kfree(request);
kfree(e);
Expand All @@ -474,7 +474,7 @@ handle_request(struct fw_card *card, struct fw_request *r,
e->request.closure = handler->closure;

queue_event(client, &e->event,
&e->request, sizeof e->request, payload, length);
&e->request, sizeof(e->request), payload, length);
}

static void
Expand All @@ -494,7 +494,7 @@ static int ioctl_allocate(struct client *client, void *buffer)
struct address_handler *handler;
struct fw_address_region region;

handler = kmalloc(sizeof *handler, GFP_KERNEL);
handler = kmalloc(sizeof(*handler), GFP_KERNEL);
if (handler == NULL)
return -ENOMEM;

Expand Down Expand Up @@ -581,7 +581,7 @@ static int ioctl_add_descriptor(struct client *client, void *buffer)
return -EINVAL;

descriptor =
kmalloc(sizeof *descriptor + request->length * 4, GFP_KERNEL);
kmalloc(sizeof(*descriptor) + request->length * 4, GFP_KERNEL);
if (descriptor == NULL)
return -ENOMEM;

Expand Down Expand Up @@ -623,7 +623,7 @@ iso_callback(struct fw_iso_context *context, u32 cycle,
struct client *client = data;
struct iso_interrupt *interrupt;

interrupt = kzalloc(sizeof *interrupt + header_length, GFP_ATOMIC);
interrupt = kzalloc(sizeof(*interrupt) + header_length, GFP_ATOMIC);
if (interrupt == NULL)
return;

Expand All @@ -634,7 +634,7 @@ iso_callback(struct fw_iso_context *context, u32 cycle,
memcpy(interrupt->interrupt.header, header, header_length);
queue_event(client, &interrupt->event,
&interrupt->interrupt,
sizeof interrupt->interrupt + header_length, NULL, 0);
sizeof(interrupt->interrupt) + header_length, NULL, 0);
}

static int ioctl_create_iso_context(struct client *client, void *buffer)
Expand Down Expand Up @@ -717,7 +717,7 @@ static int ioctl_queue_iso(struct client *client, void *buffer)
end = (void __user *)p + request->size;
count = 0;
while (p < end) {
if (__copy_from_user(&u.packet, p, sizeof *p))
if (__copy_from_user(&u.packet, p, sizeof(*p)))
return -EFAULT;

if (ctx->type == FW_ISO_CONTEXT_TRANSMIT) {
Expand Down Expand Up @@ -819,7 +819,7 @@ dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
return -EINVAL;

if (_IOC_DIR(cmd) & _IOC_WRITE) {
if (_IOC_SIZE(cmd) > sizeof buffer ||
if (_IOC_SIZE(cmd) > sizeof(buffer) ||
copy_from_user(buffer, arg, _IOC_SIZE(cmd)))
return -EFAULT;
}
Expand All @@ -829,7 +829,7 @@ dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
return retval;

if (_IOC_DIR(cmd) & _IOC_READ) {
if (_IOC_SIZE(cmd) > sizeof buffer ||
if (_IOC_SIZE(cmd) > sizeof(buffer) ||
copy_to_user(arg, buffer, _IOC_SIZE(cmd)))
return -EFAULT;
}
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/firewire/fw-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fw_unit_uevent(struct device *dev, char **envp, int num_envp,
int length = 0;
int i = 0;

get_modalias(unit, modalias, sizeof modalias);
get_modalias(unit, modalias, sizeof(modalias));

if (add_uevent_var(envp, num_envp, &i,
buffer, buffer_size, &length,
Expand Down Expand Up @@ -533,7 +533,7 @@ static void create_units(struct fw_device *device)
* Get the address of the unit directory and try to
* match the drivers id_tables against it.
*/
unit = kzalloc(sizeof *unit, GFP_KERNEL);
unit = kzalloc(sizeof(*unit), GFP_KERNEL);
if (unit == NULL) {
fw_error("failed to allocate memory for unit\n");
continue;
Expand All @@ -543,7 +543,7 @@ static void create_units(struct fw_device *device)
unit->device.bus = &fw_bus_type;
unit->device.type = &fw_unit_type;
unit->device.parent = &device->device;
snprintf(unit->device.bus_id, sizeof unit->device.bus_id,
snprintf(unit->device.bus_id, sizeof(unit->device.bus_id),
"%s.%d", device->device.bus_id, i++);

init_fw_attribute_group(&unit->device,
Expand Down Expand Up @@ -653,7 +653,7 @@ static void fw_device_init(struct work_struct *work)
device->device.type = &fw_device_type;
device->device.parent = device->card->device;
device->device.devt = MKDEV(fw_cdev_major, minor);
snprintf(device->device.bus_id, sizeof device->device.bus_id,
snprintf(device->device.bus_id, sizeof(device->device.bus_id),
"fw%d", minor);

init_fw_attribute_group(&device->device,
Expand Down
28 changes: 14 additions & 14 deletions trunk/drivers/firewire/fw-ohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ static int ar_context_add_page(struct ar_context *ctx)
return -ENOMEM;
}

memset(&ab->descriptor, 0, sizeof ab->descriptor);
memset(&ab->descriptor, 0, sizeof(ab->descriptor));
ab->descriptor.control = cpu_to_le16(DESCRIPTOR_INPUT_MORE |
DESCRIPTOR_STATUS |
DESCRIPTOR_BRANCH_ALWAYS);
Expand Down Expand Up @@ -440,7 +440,7 @@ static void context_tasklet(unsigned long data)
while (last->branch_address != 0) {
address = le32_to_cpu(last->branch_address);
z = address & 0xf;
d = ctx->buffer + (address - ctx->buffer_bus) / sizeof *d;
d = ctx->buffer + (address - ctx->buffer_bus) / sizeof(*d);
last = (z == 2) ? d : d + z - 1;

if (!ctx->callback(ctx, d, last))
Expand Down Expand Up @@ -487,7 +487,7 @@ context_init(struct context *ctx, struct fw_ohci *ohci,
* element so that head == tail means buffer full.
*/

memset(ctx->head_descriptor, 0, sizeof *ctx->head_descriptor);
memset(ctx->head_descriptor, 0, sizeof(*ctx->head_descriptor));
ctx->head_descriptor->control = cpu_to_le16(DESCRIPTOR_OUTPUT_LAST);
ctx->head_descriptor->transfer_status = cpu_to_le16(0x8011);
ctx->head_descriptor++;
Expand All @@ -512,7 +512,7 @@ context_get_descriptors(struct context *ctx, int z, dma_addr_t *d_bus)

d = ctx->head_descriptor;
tail = ctx->tail_descriptor;
end = ctx->buffer + ctx->buffer_size / sizeof(struct descriptor);
end = ctx->buffer + ctx->buffer_size / sizeof(*d);

if (d + z <= tail) {
goto has_space;
Expand All @@ -526,8 +526,8 @@ context_get_descriptors(struct context *ctx, int z, dma_addr_t *d_bus)
return NULL;

has_space:
memset(d, 0, z * sizeof *d);
*d_bus = ctx->buffer_bus + (d - ctx->buffer) * sizeof *d;
memset(d, 0, z * sizeof(*d));
*d_bus = ctx->buffer_bus + (d - ctx->buffer) * sizeof(*d);

return d;
}
Expand All @@ -548,7 +548,7 @@ static void context_append(struct context *ctx,
{
dma_addr_t d_bus;

d_bus = ctx->buffer_bus + (d - ctx->buffer) * sizeof *d;
d_bus = ctx->buffer_bus + (d - ctx->buffer) * sizeof(*d);

ctx->head_descriptor = d + z + extra;
ctx->prev_descriptor->branch_address = cpu_to_le32(d_bus | z);
Expand Down Expand Up @@ -820,7 +820,7 @@ handle_local_lock(struct fw_ohci *ohci, struct fw_packet *packet, u32 csr)
fw_notify("swap not done yet\n");

fw_fill_response(&response, packet->header,
RCODE_COMPLETE, &lock_old, sizeof lock_old);
RCODE_COMPLETE, &lock_old, sizeof(lock_old));
out:
fw_core_handle_response(&ohci->card, &response);
}
Expand Down Expand Up @@ -1376,7 +1376,7 @@ ohci_allocate_iso_context(struct fw_card *card, int type, size_t header_size)
regs = OHCI1394_IsoRcvContextBase(index);

ctx = &list[index];
memset(ctx, 0, sizeof *ctx);
memset(ctx, 0, sizeof(*ctx));
ctx->header_length = 0;
ctx->header = (void *) __get_free_page(GFP_KERNEL);
if (ctx->header == NULL)
Expand Down Expand Up @@ -1518,7 +1518,7 @@ ohci_queue_iso_transmit(struct fw_iso_context *base,
z += payload_z;

/* Get header size in number of descriptors. */
header_z = DIV_ROUND_UP(p->header_length, sizeof *d);
header_z = DIV_ROUND_UP(p->header_length, sizeof(*d));

d = context_get_descriptors(&ctx->context, z + header_z, &d_bus);
if (d == NULL)
Expand All @@ -1541,7 +1541,7 @@ ohci_queue_iso_transmit(struct fw_iso_context *base,

if (p->header_length > 0) {
d[2].req_count = cpu_to_le16(p->header_length);
d[2].data_address = cpu_to_le32(d_bus + z * sizeof *d);
d[2].data_address = cpu_to_le32(d_bus + z * sizeof(*d));
memcpy(&d[z], p->header, p->header_length);
}

Expand Down Expand Up @@ -1620,7 +1620,7 @@ ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base,
header_size = packet_count * (ctx->base.header_size + 4);

/* Get header size in number of descriptors. */
header_z = DIV_ROUND_UP(header_size, sizeof *d);
header_z = DIV_ROUND_UP(header_size, sizeof(*d));
page = payload >> PAGE_SHIFT;
offset = payload & ~PAGE_MASK;
rest = p->payload_length;
Expand All @@ -1639,7 +1639,7 @@ ohci_queue_iso_receive_dualbuffer(struct fw_iso_context *base,
db->first_size = cpu_to_le16(ctx->base.header_size + 4);
db->first_req_count = cpu_to_le16(header_size);
db->first_res_count = db->first_req_count;
db->first_buffer = cpu_to_le32(d_bus + sizeof *db);
db->first_buffer = cpu_to_le32(d_bus + sizeof(*db));

if (offset + rest < PAGE_SIZE)
length = rest;
Expand Down Expand Up @@ -1755,7 +1755,7 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
int error_code;
size_t size;

ohci = kzalloc(sizeof *ohci, GFP_KERNEL);
ohci = kzalloc(sizeof(*ohci), GFP_KERNEL);
if (ohci == NULL) {
fw_error("Could not malloc fw_ohci data.\n");
return -ENOMEM;
Expand Down
Loading

0 comments on commit 08e3d81

Please sign in to comment.