Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36bcbec7 authored by Burman Yan's avatar Burman Yan Committed by Len Brown
Browse files

ACPI: replace kmalloc+memset with kzalloc



Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 5b7b4119
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -276,12 +276,10 @@ acpi_cpufreq_cpu_init (

	dprintk("acpi_cpufreq_cpu_init\n");

	data = kmalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
	data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
	if (!data)
		return (-ENOMEM);

	memset(data, 0, sizeof(struct cpufreq_acpi_io));

	acpi_io_data[cpu] = data;

	result = acpi_processor_register_performance(&data->acpi_data, cpu);
+1 −2
Original line number Diff line number Diff line
@@ -221,10 +221,9 @@ static int acpi_ac_add(struct acpi_device *device)
	if (!device)
		return -EINVAL;

	ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL);
	ac = kzalloc(sizeof(struct acpi_ac), GFP_KERNEL);
	if (!ac)
		return -ENOMEM;
	memset(ac, 0, sizeof(struct acpi_ac));

	ac->device = device;
	strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);
+1 −2
Original line number Diff line number Diff line
@@ -395,10 +395,9 @@ static int acpi_memory_device_add(struct acpi_device *device)
	if (!device)
		return -EINVAL;

	mem_device = kmalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
	mem_device = kzalloc(sizeof(struct acpi_memory_device), GFP_KERNEL);
	if (!mem_device)
		return -ENOMEM;
	memset(mem_device, 0, sizeof(struct acpi_memory_device));

	INIT_LIST_HEAD(&mem_device->res_list);
	mem_device->device = device;
+1 −2
Original line number Diff line number Diff line
@@ -1264,10 +1264,9 @@ static int asus_hotk_add(struct acpi_device *device)
	printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n",
	       ASUS_ACPI_VERSION);

	hotk = kmalloc(sizeof(struct asus_hotk), GFP_KERNEL);
	hotk = kzalloc(sizeof(struct asus_hotk), GFP_KERNEL);
	if (!hotk)
		return -ENOMEM;
	memset(hotk, 0, sizeof(struct asus_hotk));

	hotk->handle = device->handle;
	strcpy(acpi_device_name(device), ACPI_HOTK_DEVICE_NAME);
+3 −6
Original line number Diff line number Diff line
@@ -160,12 +160,11 @@ acpi_battery_get_info(struct acpi_battery *battery,
		goto end;
	}

	data.pointer = kmalloc(data.length, GFP_KERNEL);
	data.pointer = kzalloc(data.length, GFP_KERNEL);
	if (!data.pointer) {
		result = -ENOMEM;
		goto end;
	}
	memset(data.pointer, 0, data.length);

	status = acpi_extract_package(package, &format, &data);
	if (ACPI_FAILURE(status)) {
@@ -220,12 +219,11 @@ acpi_battery_get_status(struct acpi_battery *battery,
		goto end;
	}

	data.pointer = kmalloc(data.length, GFP_KERNEL);
	data.pointer = kzalloc(data.length, GFP_KERNEL);
	if (!data.pointer) {
		result = -ENOMEM;
		goto end;
	}
	memset(data.pointer, 0, data.length);

	status = acpi_extract_package(package, &format, &data);
	if (ACPI_FAILURE(status)) {
@@ -694,10 +692,9 @@ static int acpi_battery_add(struct acpi_device *device)
	if (!device)
		return -EINVAL;

	battery = kmalloc(sizeof(struct acpi_battery), GFP_KERNEL);
	battery = kzalloc(sizeof(struct acpi_battery), GFP_KERNEL);
	if (!battery)
		return -ENOMEM;
	memset(battery, 0, sizeof(struct acpi_battery));

	battery->device = device;
	strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME);
Loading