diff options
author | Burman Yan <yan_952@hotmail.com> | 2006-12-19 12:56:11 -0800 |
---|---|---|
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) | |
download | linux-36bcbec7ce21e2e8b3143b11a05747330abeca70.tar.bz2 |
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) int count = 0; union acpi_object *o; - br = kmalloc(sizeof(*br), GFP_KERNEL); + br = kzalloc(sizeof(*br), GFP_KERNEL); if (!br) { printk(KERN_ERR "can't allocate memory\n"); } else { - memset(br, 0, sizeof(*br)); br->levels = kmalloc(obj->package.count * sizeof *(br->levels), GFP_KERNEL); if (!br->levels) @@ -1260,12 +1259,10 @@ acpi_video_bus_get_one_device(struct acpi_device *device, acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); if (ACPI_SUCCESS(status)) { - data = kmalloc(sizeof(struct acpi_video_device), GFP_KERNEL); + data = kzalloc(sizeof(struct acpi_video_device), GFP_KERNEL); if (!data) return -ENOMEM; - memset(data, 0, sizeof(struct acpi_video_device)); - strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); acpi_driver_data(device) = data; @@ -1718,10 +1715,9 @@ static int acpi_video_bus_add(struct acpi_device *device) if (!device) return -EINVAL; - video = kmalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); + video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); if (!video) return -ENOMEM; - memset(video, 0, sizeof(struct acpi_video_bus)); video->device = device; strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); |