From 36bcbec7ce21e2e8b3143b11a05747330abeca70 Mon Sep 17 00:00:00 2001 From: Burman Yan Date: Tue, 19 Dec 2006 12:56:11 -0800 Subject: ACPI: replace kmalloc+memset with kzalloc Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/video.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'drivers/acpi/video.c') diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index eb5141f9ef8..36b37d755db 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); -- cgit v1.2.3-70-g09d2