Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151483
b: refs/heads/master
c: e5333db
h: refs/heads/master
i:
  151481: b1df980
  151479: 63a3b35
v: v3
  • Loading branch information
Stefan Richter committed Jun 1, 2009
1 parent 55fafd1 commit 9837c61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: 92368890d551794ee8d7e90477d8498bb7f82a9b
refs/heads/master: e5333db9285e088a98f4bad5147bfb0b4665fafb
11 changes: 9 additions & 2 deletions trunk/drivers/firewire/fw-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,7 @@ static void init_fw_attribute_group(struct device *dev,
group->attrs[j++] = &attr->attr;
}

BUG_ON(j >= ARRAY_SIZE(group->attrs));
group->attrs[j++] = NULL;
group->attrs[j] = NULL;
group->groups[0] = &group->group;
group->groups[1] = NULL;
group->group.attrs = group->attrs;
Expand Down Expand Up @@ -570,9 +569,13 @@ static void create_units(struct fw_device *device)
unit->device.parent = &device->device;
dev_set_name(&unit->device, "%s.%d", dev_name(&device->device), i++);

BUILD_BUG_ON(ARRAY_SIZE(unit->attribute_group.attrs) <
ARRAY_SIZE(fw_unit_attributes) +
ARRAY_SIZE(config_rom_attributes));
init_fw_attribute_group(&unit->device,
fw_unit_attributes,
&unit->attribute_group);

if (device_register(&unit->device) < 0)
goto skip_unit;

Expand Down Expand Up @@ -849,9 +852,13 @@ static void fw_device_init(struct work_struct *work)
device->device.devt = MKDEV(fw_cdev_major, minor);
dev_set_name(&device->device, "fw%d", minor);

BUILD_BUG_ON(ARRAY_SIZE(device->attribute_group.attrs) <
ARRAY_SIZE(fw_device_attributes) +
ARRAY_SIZE(config_rom_attributes));
init_fw_attribute_group(&device->device,
fw_device_attributes,
&device->attribute_group);

if (device_add(&device->device)) {
fw_error("Failed to add device.\n");
goto error_with_cdev;
Expand Down

0 comments on commit 9837c61

Please sign in to comment.