diff options
author | Burman Yan <yan_952@hotmail.com> | 2006-12-19 15:56:11 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-12-20 16:54:54 -0500 |
commit | 36bcbec7ce21e2e8b3143b11a05747330abeca70 (patch) | |
tree | d9ace4d83a5013dbb3cd599e7bc4358ce4cdb980 /drivers/acpi/video.c | |
parent | 5b7b4119553dd7cc0bc200c0d1b1598e158eec9a (diff) |
ACPI: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index eb5141f9ef8f..36b37d755dbc 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -533,11 +533,10 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
533 | int count = 0; | 533 | int count = 0; |
534 | union acpi_object *o; | 534 | union acpi_object *o; |
535 | 535 | ||
536 | br = kmalloc(sizeof(*br), GFP_KERNEL); | 536 | br = kzalloc(sizeof(*br), GFP_KERNEL); |
537 | if (!br) { | 537 | if (!br) { |
538 | printk(KERN_ERR "can't allocate memory\n"); | 538 | printk(KERN_ERR "can't allocate memory\n"); |
539 | } else { | 539 | } else { |
540 | memset(br, 0, sizeof(*br)); | ||
541 | br->levels = kmalloc(obj->package.count * | 540 | br->levels = kmalloc(obj->package.count * |
542 | sizeof *(br->levels), GFP_KERNEL); | 541 | sizeof *(br->levels), GFP_KERNEL); |
543 | if (!br->levels) | 542 | if (!br->levels) |
@@ -1260,12 +1259,10 @@ acpi_video_bus_get_one_device(struct acpi_device *device, | |||
1260 | acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); | 1259 | acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); |
1261 | if (ACPI_SUCCESS(status)) { | 1260 | if (ACPI_SUCCESS(status)) { |
1262 | 1261 | ||
1263 | data = kmalloc(sizeof(struct acpi_video_device), GFP_KERNEL); | 1262 | data = kzalloc(sizeof(struct acpi_video_device), GFP_KERNEL); |
1264 | if (!data) | 1263 | if (!data) |
1265 | return -ENOMEM; | 1264 | return -ENOMEM; |
1266 | 1265 | ||
1267 | memset(data, 0, sizeof(struct acpi_video_device)); | ||
1268 | |||
1269 | strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); | 1266 | strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); |
1270 | strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); | 1267 | strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); |
1271 | acpi_driver_data(device) = data; | 1268 | acpi_driver_data(device) = data; |
@@ -1718,10 +1715,9 @@ static int acpi_video_bus_add(struct acpi_device *device) | |||
1718 | if (!device) | 1715 | if (!device) |
1719 | return -EINVAL; | 1716 | return -EINVAL; |
1720 | 1717 | ||
1721 | video = kmalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); | 1718 | video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); |
1722 | if (!video) | 1719 | if (!video) |
1723 | return -ENOMEM; | 1720 | return -ENOMEM; |
1724 | memset(video, 0, sizeof(struct acpi_video_bus)); | ||
1725 | 1721 | ||
1726 | video->device = device; | 1722 | video->device = device; |
1727 | strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); | 1723 | strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); |