acpi: replace kmalloc+memset with kzalloc
Subsystems (3)
PATCH 4/19 acpi: replace kmalloc+memset with kzalloc
From: "Burman Yan" <[email protected]>
---
arch/ia64/kernel/cpufreq/acpi-cpufreq.c | 4 +--- drivers/acpi/ac.c | 3 +-- drivers/acpi/acpi_memhotplug.c | 3 +-- drivers/acpi/asus_acpi.c | 3 +-- drivers/acpi/battery.c | 9 +++------ drivers/acpi/container.c | 3 +-- drivers/acpi/ec.c | 9 +++------ drivers/acpi/fan.c | 3 +-- drivers/acpi/i2c_ec.c | 6 ++---- drivers/acpi/ibm_acpi.c | 3 +-- drivers/acpi/pci_bind.c | 16 +++++----------- drivers/acpi/pci_irq.c | 9 +++------ drivers/acpi/pci_link.c | 6 ++---- drivers/acpi/pci_root.c | 3 +-- drivers/acpi/power.c | 3 +-- drivers/acpi/processor_core.c | 3 +-- drivers/acpi/sbs.c | 3 +-- drivers/acpi/scan.c | 3 +-- drivers/acpi/thermal.c | 7 ++----- drivers/acpi/utils.c | 6 ++---- drivers/acpi/video.c | 10 +++------- drivers/pci/hotplug/acpiphp_ibm.c | 3 +-- 22 files changed, 38 insertions(+), 80 deletions(-)
arch/ia64/kernel/cpufreq/acpi-cpufreq.c renamed from arch/ia64/kernel/cpufreq/acpi-cpufreq.c~acpi-replace-kmallocmemset-with-kzalloc +1 -3
@@ -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);
drivers/acpi/ac.c renamed from drivers/acpi/ac.c~acpi-replace-kmallocmemset-with-kzalloc +1 -2
@@ -221,10 +221,9 @@ static int acpi_ac_add(struct acpi_devicif (!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 );
drivers/acpi/acpi_memhotplug.c renamed from drivers/acpi/acpi_memhotplug.c~acpi-replace-kmallocmemset-with-kzalloc +1 -2
@@ -395,10 +395,9 @@ static int acpi_memory_device_add(structif (!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;
drivers/acpi/asus_acpi.c renamed from drivers/acpi/asus_acpi.c~acpi-replace-kmallocmemset-with-kzalloc +1 -2
@@ -1264,10 +1264,9 @@ static int asus_hotk_add(struct acpi_devprintk (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 );
drivers/acpi/battery.c renamed from drivers/acpi/battery.c~acpi-replace-kmallocmemset-with-kzalloc +3 -6
@@ -160,12 +160,11 @@ acpi_battery_get_info(struct acpi_batter 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_batt 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_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 );
drivers/acpi/container.c renamed from drivers/acpi/container.c~acpi-replace-kmallocmemset-with-kzalloc +1 -2
@@ -96,11 +96,10 @@ static int acpi_container_add(struct acpreturn -EINVAL ; } - container =kmalloc (sizeof (struct acpi_container ),GFP_KERNEL ); + container =kzalloc (sizeof (struct acpi_container ),GFP_KERNEL );if (!container)return -ENOMEM ; -memset (container,0 ,sizeof (struct acpi_container )); container->handle = device->handle;strcpy (acpi_device_name (device),ACPI_CONTAINER_DEVICE_NAME );strcpy (acpi_device_class (device),ACPI_CONTAINER_CLASS );
drivers/acpi/ec.c renamed from drivers/acpi/ec.c~acpi-replace-kmallocmemset-with-kzalloc +3 -6
@@ -624,10 +624,9 @@ static int acpi_ec_add(struct acpi_devicif (!device)return -EINVAL ; - ec =kmalloc (sizeof (struct acpi_ec ),GFP_KERNEL ); + ec =kzalloc (sizeof (struct acpi_ec ),GFP_KERNEL );if (!ec)return -ENOMEM ; -memset (ec,0 ,sizeof (struct acpi_ec )); ec->handle = device->handle; ec->uid =-1 ;
@@ -848,12 +847,11 @@ static int __init acpi_ec_fake_ecdt(voidACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Try to make an fake ECDT" )); - ec_ecdt =kmalloc (sizeof (struct acpi_ec ),GFP_KERNEL ); + ec_ecdt =kzalloc (sizeof (struct acpi_ec ),GFP_KERNEL );if (!ec_ecdt) { ret = -ENOMEM ; goto error; } -memset (ec_ecdt,0 ,sizeof (struct acpi_ec )); status =acpi_get_devices (ACPI_EC_HID , acpi_fake_ecdt_callback,NULL ,NULL );
@@ -885,10 +883,9 @@ static int __init acpi_ec_get_real_ecdt(/* * Generate a temporary ec context to use until the namespace is scanned */ - ec_ecdt =kmalloc (sizeof (struct acpi_ec ),GFP_KERNEL ); + ec_ecdt =kzalloc (sizeof (struct acpi_ec ),GFP_KERNEL );if (!ec_ecdt)return -ENOMEM ; -memset (ec_ecdt,0 ,sizeof (struct acpi_ec ));mutex_init (&ec_ecdt->lock);if (acpi_ec_mode ==EC_INTR ) {
drivers/acpi/fan.c renamed from drivers/acpi/fan.c~acpi-replace-kmallocmemset-with-kzalloc +1 -2
@@ -186,10 +186,9 @@ static int acpi_fan_add(struct acpi_deviif (!device)return -EINVAL ; - fan =kmalloc (sizeof (struct acpi_fan ),GFP_KERNEL ); + fan =kzalloc (sizeof (struct acpi_fan ),GFP_KERNEL );if (!fan)return -ENOMEM ; -memset (fan,0 ,sizeof (struct acpi_fan )); fan->device = device;strcpy (acpi_device_name (device),"Fan" );
drivers/acpi/i2c_ec.c renamed from drivers/acpi/i2c_ec.c~acpi-replace-kmallocmemset-with-kzalloc +2 -4
@@ -309,18 +309,16 @@ static int acpi_ec_hc_add(struct acpi_dereturn -EINVAL ; } - ec_hc =kmalloc (sizeof (struct acpi_ec_hc ),GFP_KERNEL ); + ec_hc =kzalloc (sizeof (struct acpi_ec_hc ),GFP_KERNEL );if (!ec_hc) {return -ENOMEM ; } -memset (ec_hc,0 ,sizeof (struct acpi_ec_hc )); - smbus =kmalloc (sizeof (struct acpi_ec_smbus ),GFP_KERNEL ); + smbus =kzalloc (sizeof (struct acpi_ec_smbus ),GFP_KERNEL );if (!smbus) {kfree (ec_hc);return -ENOMEM ; } -memset (smbus,0 ,sizeof (struct acpi_ec_smbus )); ec_hc->handle = device->handle;strcpy (acpi_device_name (device),ACPI_EC_HC_DEVICE_NAME );
drivers/acpi/ibm_acpi.c renamed from drivers/acpi/ibm_acpi.c~acpi-replace-kmallocmemset-with-kzalloc +1 -2
@@ -2516,13 +2516,12 @@ static int __init register_driver(struct {int ret; - ibm->driver =kmalloc (sizeof (struct acpi_driver ),GFP_KERNEL ); + ibm->driver =kzalloc (sizeof (struct acpi_driver ),GFP_KERNEL );if (!ibm->driver) {printk (IBM_ERR "kmalloc(ibm->driver) failed\n" );return -1 ; } -memset (ibm->driver,0 ,sizeof (struct acpi_driver ));sprintf (ibm->driver->name,"%s_%s" ,IBM_NAME , ibm->name); ibm->driver->ids = ibm->hid; ibm->driver->ops.add = &ibm_device_add;
drivers/acpi/pci_bind.c renamed from drivers/acpi/pci_bind.c~acpi-replace-kmallocmemset-with-kzalloc +5 -11
@@ -122,19 +122,17 @@ int acpi_pci_bind(struct acpi_device *deif (!device || !device->parent)return -EINVAL ; - pathname =kmalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL ); + pathname =kzalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL );if (!pathname)return -ENOMEM ; -memset (pathname,0 ,ACPI_PATHNAME_MAX ); buffer.length =ACPI_PATHNAME_MAX ; buffer.pointer = pathname; - data =kmalloc (sizeof (struct acpi_pci_data ),GFP_KERNEL ); + data =kzalloc (sizeof (struct acpi_pci_data ),GFP_KERNEL );if (!data) {kfree (pathname);return -ENOMEM ; } -memset (data,0 ,sizeof (struct acpi_pci_data ));acpi_get_name (device->handle,ACPI_FULL_PATHNAME , &buffer); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Binding PCI device [%s]...\n",
@@ -281,10 +279,9 @@ int acpi_pci_unbind(struct acpi_device *if (!device || !device->parent)return -EINVAL ; - pathname =kmalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL ); + pathname =kzalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL );if (!pathname)return -ENOMEM ; -memset (pathname,0 ,ACPI_PATHNAME_MAX ); buffer.length =ACPI_PATHNAME_MAX ; buffer.pointer = pathname;
@@ -331,11 +328,9 @@ acpi_pci_bind_root(struct acpi_device *dchar *pathname =NULL ;struct acpi_buffer buffer = {0 ,NULL }; - - pathname =kmalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL ); + pathname =kzalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL );if (!pathname)return -ENOMEM ; -memset (pathname,0 ,ACPI_PATHNAME_MAX ); buffer.length =ACPI_PATHNAME_MAX ; buffer.pointer = pathname;
@@ -345,12 +340,11 @@ acpi_pci_bind_root(struct acpi_device *dreturn -EINVAL ; } - data =kmalloc (sizeof (struct acpi_pci_data ),GFP_KERNEL ); + data =kzalloc (sizeof (struct acpi_pci_data ),GFP_KERNEL );if (!data) {kfree (pathname);return -ENOMEM ; } -memset (data,0 ,sizeof (struct acpi_pci_data )); data->id = *id; data->bus = bus;
drivers/acpi/pci_irq.c renamed from drivers/acpi/pci_irq.c~acpi-replace-kmallocmemset-with-kzalloc +3 -6
@@ -89,10 +89,9 @@ acpi_pci_irq_add_entry(acpi_handle handlif (!prt)return -EINVAL ; - entry =kmalloc (sizeof (struct acpi_prt_entry ),GFP_KERNEL ); + entry =kzalloc (sizeof (struct acpi_prt_entry ),GFP_KERNEL );if (!entry)return -ENOMEM ; -memset (entry,0 ,sizeof (struct acpi_prt_entry )); entry->id.segment = segment; entry->id.bus = bus;
@@ -161,10 +160,9 @@ int acpi_pci_irq_add_prt(acpi_handle hanstatic int first_time =1 ; - pathname =kmalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL ); + pathname =kzalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL );if (!pathname)return -ENOMEM ; -memset (pathname,0 ,ACPI_PATHNAME_MAX );if (first_time) { acpi_prt.count =0 ;
@@ -198,11 +196,10 @@ int acpi_pci_irq_add_prt(acpi_handle hanreturn -ENODEV ; } - prt =kmalloc (buffer.length,GFP_KERNEL ); + prt =kzalloc (buffer.length,GFP_KERNEL );if (!prt) {return -ENOMEM ; } -memset (prt,0 , buffer.length); buffer.pointer = prt; status =acpi_get_irq_routing_table (handle, &buffer);
drivers/acpi/pci_link.c renamed from drivers/acpi/pci_link.c~acpi-replace-kmallocmemset-with-kzalloc +2 -4
@@ -307,11 +307,10 @@ static int acpi_pci_link_set(struct acpiif (!link || !irq)return -EINVAL ; - resource =kmalloc (sizeof (*resource) +1 ,irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL ); + resource =kzalloc (sizeof (*resource) +1 ,irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL );if (!resource)return -ENOMEM ; -memset (resource,0 ,sizeof (*resource) +1 ); buffer.length =sizeof (*resource) +1 ; buffer.pointer = resource;
@@ -718,10 +717,9 @@ static int acpi_pci_link_add(struct acpiif (!device)return -EINVAL ; - link =kmalloc (sizeof (struct acpi_pci_link ),GFP_KERNEL ); + link =kzalloc (sizeof (struct acpi_pci_link ),GFP_KERNEL );if (!link)return -ENOMEM ; -memset (link,0 ,sizeof (struct acpi_pci_link )); link->device = device;strcpy (acpi_device_name (device),ACPI_PCI_LINK_DEVICE_NAME );
drivers/acpi/pci_root.c renamed from drivers/acpi/pci_root.c~acpi-replace-kmallocmemset-with-kzalloc +1 -2
@@ -165,10 +165,9 @@ static int acpi_pci_root_add(struct acpiif (!device)return -EINVAL ; - root =kmalloc (sizeof (struct acpi_pci_root ),GFP_KERNEL ); + root =kzalloc (sizeof (struct acpi_pci_root ),GFP_KERNEL );if (!root)return -ENOMEM ; -memset (root,0 ,sizeof (struct acpi_pci_root ));INIT_LIST_HEAD (&root->node); root->device = device;
drivers/acpi/power.c renamed from drivers/acpi/power.c~acpi-replace-kmallocmemset-with-kzalloc +1 -2
@@ -532,10 +532,9 @@ static int acpi_power_add(struct acpi_deif (!device)return -EINVAL ; - resource =kmalloc (sizeof (struct acpi_power_resource ),GFP_KERNEL ); + resource =kzalloc (sizeof (struct acpi_power_resource ),GFP_KERNEL );if (!resource)return -ENOMEM ; -memset (resource,0 ,sizeof (struct acpi_power_resource )); resource->device = device;strcpy (resource->name, device->pnp.bus_id);
drivers/acpi/processor_core.c renamed from drivers/acpi/processor_core.c~acpi-replace-kmallocmemset-with-kzalloc +1 -2
@@ -615,10 +615,9 @@ static int acpi_processor_add(struct acpif (!device)return -EINVAL ; - pr =kmalloc (sizeof (struct acpi_processor ),GFP_KERNEL ); + pr =kzalloc (sizeof (struct acpi_processor ),GFP_KERNEL );if (!pr)return -ENOMEM ; -memset (pr,0 ,sizeof (struct acpi_processor )); pr->handle = device->handle;strcpy (acpi_device_name (device),ACPI_PROCESSOR_DEVICE_NAME );
drivers/acpi/sbs.c renamed from drivers/acpi/sbs.c~acpi-replace-kmallocmemset-with-kzalloc +1 -2
@@ -1576,12 +1576,11 @@ static int acpi_sbs_add(struct acpi_deviint id, cnt;acpi_status status =AE_OK ; - sbs =kmalloc (sizeof (struct acpi_sbs ),GFP_KERNEL ); + sbs =kzalloc (sizeof (struct acpi_sbs ),GFP_KERNEL );if (!sbs) {ACPI_DEBUG_PRINT ((ACPI_DB_ERROR ,"kmalloc() failed\n" ));return -ENOMEM ; } -memset (sbs,0 ,sizeof (struct acpi_sbs )); cnt =0 ;while (cnt <10 ) {
drivers/acpi/scan.c renamed from drivers/acpi/scan.c~acpi-replace-kmallocmemset-with-kzalloc +1 -2
@@ -984,12 +984,11 @@ acpi_add_single_object(struct acpi_devicif (!child)return -EINVAL ; - device =kmalloc (sizeof (struct acpi_device ),GFP_KERNEL ); + device =kzalloc (sizeof (struct acpi_device ),GFP_KERNEL );if (!device) { printk(KERN_ERR PREFIX "Memory allocation error\n");return -ENOMEM ; } -memset (device,0 ,sizeof (struct acpi_device )); device->handle = handle; device->parent = parent;
drivers/acpi/thermal.c renamed from drivers/acpi/thermal.c~acpi-replace-kmallocmemset-with-kzalloc +2 -5
@@ -902,12 +902,10 @@ acpi_thermal_write_trip_points(struct fiint i =0 ; - limit_string =kmalloc (ACPI_THERMAL_MAX_LIMIT_STR_LEN ,GFP_KERNEL ); + limit_string =kzalloc (ACPI_THERMAL_MAX_LIMIT_STR_LEN ,GFP_KERNEL );if (!limit_string)return -ENOMEM ; -memset (limit_string,0 ,ACPI_THERMAL_MAX_LIMIT_STR_LEN ); - active =kmalloc (ACPI_THERMAL_MAX_ACTIVE *sizeof (int ),GFP_KERNEL );if (!active) {kfree (limit_string);
@@ -1271,10 +1269,9 @@ static int acpi_thermal_add(struct acpi_if (!device)return -EINVAL ; - tz =kmalloc (sizeof (struct acpi_thermal ),GFP_KERNEL ); + tz =kzalloc (sizeof (struct acpi_thermal ),GFP_KERNEL );if (!tz)return -ENOMEM ; -memset (tz,0 ,sizeof (struct acpi_thermal )); tz->device = device;strcpy (tz->name, device->pnp.bus_id);
drivers/acpi/utils.c renamed from drivers/acpi/utils.c~acpi-replace-kmallocmemset-with-kzalloc +2 -4
@@ -262,11 +262,10 @@ acpi_evaluate_integer(acpi_handle handleif (!data)return AE_BAD_PARAMETER ; - element =kmalloc (sizeof (union acpi_object ),irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL ); + element =kzalloc (sizeof (union acpi_object ),irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL );if (!element)return AE_NO_MEMORY ; -memset (element,0 ,sizeof (union acpi_object )); buffer.length =sizeof (union acpi_object ); buffer.pointer = element; status =acpi_evaluate_object (handle, pathname, arguments, &buffer);
@@ -321,12 +320,11 @@ acpi_evaluate_string(acpi_handle handle,return AE_BAD_DATA ; } - *data =kmalloc (element->string.length +1 ,GFP_KERNEL ); + *data =kzalloc (element->string.length +1 ,GFP_KERNEL );if (!data) { printk(KERN_ERR PREFIX "Memory allocation\n");return -ENOMEM ; } -memset (*data,0 , element->string.length +1 );memcpy (*data, element->string.pointer, element->string.length);
drivers/acpi/video.c renamed from drivers/acpi/video.c~acpi-replace-kmallocmemset-with-kzalloc +3 -7
@@ -532,11 +532,10 @@ static void acpi_video_device_find_cap(sint 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)
@@ -1259,12 +1258,10 @@ acpi_video_bus_get_one_device(struct acpacpi_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;
@@ -1691,10 +1688,9 @@ static int acpi_video_bus_add(struct acpif (!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 );
drivers/pci/hotplug/acpiphp_ibm.c renamed from drivers/pci/hotplug/acpiphp_ibm.c~acpi-replace-kmallocmemset-with-kzalloc +1 -2
@@ -319,13 +319,12 @@ static int ibm_get_table_from_acpi(charif (bufp ==NULL ) goto read_table_done; - lbuf =kmalloc (size,GFP_KERNEL ); + lbuf =kzalloc (size,GFP_KERNEL );dbg ("%s: element count: %i, ASL table size: %i, &table = 0x%p\n" , __FUNCTION__, package->package.count, size, lbuf);if (lbuf) { *bufp = lbuf; -memset (lbuf,0 , size); }else { size = -ENOMEM ; goto read_table_done;
_
Len Brown
reviewerCleanup patches like this make it very difficult to work with -mm, as they conflict with just about every possible change.
This means that if I don't apply patches in the same order as Andrew's quilt series, then I've got merge hell. And experience shows that there is a 0% chance that I can apply patches in the order that -mm does.
All this, for zero functional benefit.
Andrew, please do not accept cleanup patches in -mm that touch ACPI files. It would be easier if they were sent to me and I got to choose when the "flag days" occur based on what other patches are in the queue to Linus.
thanks,
-Len
Quoted 586 lines · On Tuesday 19 December 2006 15:56, [email protected] wrote:
From: "Burman Yan" <[email protected]>
Signed-off-by Andrew Morton <[email protected]>---
arch/ia64/kernel/cpufreq/acpi-cpufreq.c | 4 +--- drivers/acpi/ac.c | 3 +-- drivers/acpi/acpi_memhotplug.c | 3 +-- drivers/acpi/asus_acpi.c | 3 +-- drivers/acpi/battery.c | 9 +++------ drivers/acpi/container.c | 3 +-- drivers/acpi/ec.c | 9 +++------ drivers/acpi/fan.c | 3 +-- drivers/acpi/i2c_ec.c | 6 ++---- drivers/acpi/ibm_acpi.c | 3 +-- drivers/acpi/pci_bind.c | 16 +++++----------- drivers/acpi/pci_irq.c | 9 +++------ drivers/acpi/pci_link.c | 6 ++---- drivers/acpi/pci_root.c | 3 +-- drivers/acpi/power.c | 3 +-- drivers/acpi/processor_core.c | 3 +-- drivers/acpi/sbs.c | 3 +-- drivers/acpi/scan.c | 3 +-- drivers/acpi/thermal.c | 7 ++----- drivers/acpi/utils.c | 6 ++---- drivers/acpi/video.c | 10 +++------- drivers/pci/hotplug/acpiphp_ibm.c | 3 +-- 22 files changed, 38 insertions(+), 80 deletions(-)diff -puN
arch/ia64/kernel/cpufreq/acpi-cpufreq.c~acpi-replace-kmallocmemset-with-kzallocarch/ia64/kernel/cpufreq/acpi-cpufreq.carch/ia64/kernel/cpufreq/acpi-cpufreq.c renamed from arch/ia64/kernel/cpufreq/acpi-cpufreq.c~acpi-replace-kmallocmemset-with-kzalloc +1
-3@@ -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);diff -puN
drivers/acpi/ac.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/ac.cdrivers/acpi/ac.c renamed from drivers/acpi/ac.c~acpi-replace-kmallocmemset-with-kzalloc +1
-2@@ -221,10 +221,9 @@ static int acpi_ac_add(struct acpi_devicif (!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 );diff -puN
drivers/acpi/acpi_memhotplug.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/acpi_memhotplug.cdrivers/acpi/acpi_memhotplug.c renamed from drivers/acpi/acpi_memhotplug.c~acpi-replace-kmallocmemset-with-kzalloc +1
-2@@ -395,10 +395,9 @@ static int acpi_memory_device_add(structif (!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;diff -puN
drivers/acpi/asus_acpi.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/asus_acpi.cdrivers/acpi/asus_acpi.c renamed from drivers/acpi/asus_acpi.c~acpi-replace-kmallocmemset-with-kzalloc +1
-2@@ -1264,10 +1264,9 @@ static int asus_hotk_add(struct acpi_devprintk (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 );diff -puN
drivers/acpi/battery.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/battery.cdrivers/acpi/battery.c renamed from drivers/acpi/battery.c~acpi-replace-kmallocmemset-with-kzalloc +3
-6@@ -160,12 +160,11 @@ acpi_battery_get_info(struct acpi_batter 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_batt 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_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 );diff -puN
drivers/acpi/container.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/container.cdrivers/acpi/container.c renamed from drivers/acpi/container.c~acpi-replace-kmallocmemset-with-kzalloc +1
-2@@ -96,11 +96,10 @@ static int acpi_container_add(struct acpreturn -EINVAL ; } - container =kmalloc (sizeof (struct acpi_container ),GFP_KERNEL ); + container =kzalloc (sizeof (struct acpi_container ),GFP_KERNEL );if (!container)return -ENOMEM ; -memset (container,0 ,sizeof (struct acpi_container )); container->handle = device->handle;strcpy (acpi_device_name (device),ACPI_CONTAINER_DEVICE_NAME );strcpy (acpi_device_class (device),ACPI_CONTAINER_CLASS );diff -puN
drivers/acpi/ec.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/ec.cdrivers/acpi/ec.c renamed from drivers/acpi/ec.c~acpi-replace-kmallocmemset-with-kzalloc +3
-6@@ -624,10 +624,9 @@ static int acpi_ec_add(struct acpi_devicif (!device)return -EINVAL ; - ec =kmalloc (sizeof (struct acpi_ec ),GFP_KERNEL ); + ec =kzalloc (sizeof (struct acpi_ec ),GFP_KERNEL );if (!ec)return -ENOMEM ; -memset (ec,0 ,sizeof (struct acpi_ec )); ec->handle = device->handle; ec->uid =-1 ;@@ -848,12 +847,11 @@ static int __init acpi_ec_fake_ecdt(voidACPI_DEBUG_PRINT ((ACPI_DB_INFO ,"Try to make an fake ECDT" )); - ec_ecdt =kmalloc (sizeof (struct acpi_ec ),GFP_KERNEL ); + ec_ecdt =kzalloc (sizeof (struct acpi_ec ),GFP_KERNEL );if (!ec_ecdt) { ret = -ENOMEM ; goto error; } -memset (ec_ecdt,0 ,sizeof (struct acpi_ec )); status =acpi_get_devices (ACPI_EC_HID , acpi_fake_ecdt_callback,NULL ,NULL );@@ -885,10 +883,9 @@ static int __init acpi_ec_get_real_ecdt(/* * Generate a temporary ec context to use until the namespace is scanned */ - ec_ecdt =kmalloc (sizeof (struct acpi_ec ),GFP_KERNEL ); + ec_ecdt =kzalloc (sizeof (struct acpi_ec ),GFP_KERNEL );if (!ec_ecdt)return -ENOMEM ; -memset (ec_ecdt,0 ,sizeof (struct acpi_ec ));mutex_init (&ec_ecdt->lock);if (acpi_ec_mode ==EC_INTR ) {diff -puN
drivers/acpi/fan.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/fan.cdrivers/acpi/fan.c renamed from drivers/acpi/fan.c~acpi-replace-kmallocmemset-with-kzalloc +1
-2@@ -186,10 +186,9 @@ static int acpi_fan_add(struct acpi_deviif (!device)return -EINVAL ; - fan =kmalloc (sizeof (struct acpi_fan ),GFP_KERNEL ); + fan =kzalloc (sizeof (struct acpi_fan ),GFP_KERNEL );if (!fan)return -ENOMEM ; -memset (fan,0 ,sizeof (struct acpi_fan )); fan->device = device;strcpy (acpi_device_name (device),"Fan" );diff -puN
drivers/acpi/i2c_ec.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/i2c_ec.cdrivers/acpi/i2c_ec.c renamed from drivers/acpi/i2c_ec.c~acpi-replace-kmallocmemset-with-kzalloc +2
-4@@ -309,18 +309,16 @@ static int acpi_ec_hc_add(struct acpi_dereturn -EINVAL ; } - ec_hc =kmalloc (sizeof (struct acpi_ec_hc ),GFP_KERNEL ); + ec_hc =kzalloc (sizeof (struct acpi_ec_hc ),GFP_KERNEL );if (!ec_hc) {return -ENOMEM ; } -memset (ec_hc,0 ,sizeof (struct acpi_ec_hc )); - smbus =kmalloc (sizeof (struct acpi_ec_smbus ),GFP_KERNEL ); + smbus =kzalloc (sizeof (struct acpi_ec_smbus ),GFP_KERNEL );if (!smbus) {kfree (ec_hc);return -ENOMEM ; } -memset (smbus,0 ,sizeof (struct acpi_ec_smbus )); ec_hc->handle = device->handle;strcpy (acpi_device_name (device),ACPI_EC_HC_DEVICE_NAME );diff -puN
drivers/acpi/ibm_acpi.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/ibm_acpi.cdrivers/acpi/ibm_acpi.c renamed from drivers/acpi/ibm_acpi.c~acpi-replace-kmallocmemset-with-kzalloc +1
-2@@ -2516,13 +2516,12 @@ static int __init register_driver(struct {int ret; - ibm->driver =kmalloc (sizeof (struct acpi_driver ),GFP_KERNEL ); + ibm->driver =kzalloc (sizeof (struct acpi_driver ),GFP_KERNEL );if (!ibm->driver) {printk (IBM_ERR "kmalloc(ibm->driver) failed\n" );return -1 ; } -memset (ibm->driver,0 ,sizeof (struct acpi_driver ));sprintf (ibm->driver->name,"%s_%s" ,IBM_NAME , ibm->name); ibm->driver->ids = ibm->hid; ibm->driver->ops.add = &ibm_device_add;diff -puN
drivers/acpi/pci_bind.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/pci_bind.cdrivers/acpi/pci_bind.c renamed from drivers/acpi/pci_bind.c~acpi-replace-kmallocmemset-with-kzalloc +5
-11@@ -122,19 +122,17 @@ int acpi_pci_bind(struct acpi_device *deif (!device || !device->parent)return -EINVAL ; - pathname =kmalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL ); + pathname =kzalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL );if (!pathname)return -ENOMEM ; -memset (pathname,0 ,ACPI_PATHNAME_MAX ); buffer.length =ACPI_PATHNAME_MAX ; buffer.pointer = pathname; - data =kmalloc (sizeof (struct acpi_pci_data ),GFP_KERNEL ); + data =kzalloc (sizeof (struct acpi_pci_data ),GFP_KERNEL );if (!data) {kfree (pathname);return -ENOMEM ; } -memset (data,0 ,sizeof (struct acpi_pci_data ));acpi_get_name (device->handle,ACPI_FULL_PATHNAME , &buffer); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Binding PCI device [%s]...\n",@@ -281,10 +279,9 @@ int acpi_pci_unbind(struct acpi_device *if (!device || !device->parent)return -EINVAL ; - pathname =kmalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL ); + pathname =kzalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL );if (!pathname)return -ENOMEM ; -memset (pathname,0 ,ACPI_PATHNAME_MAX ); buffer.length =ACPI_PATHNAME_MAX ; buffer.pointer = pathname;@@ -331,11 +328,9 @@ acpi_pci_bind_root(struct acpi_device *dchar *pathname =NULL ;struct acpi_buffer buffer = {0 ,NULL }; - - pathname =kmalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL ); + pathname =kzalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL );if (!pathname)return -ENOMEM ; -memset (pathname,0 ,ACPI_PATHNAME_MAX ); buffer.length =ACPI_PATHNAME_MAX ; buffer.pointer = pathname;@@ -345,12 +340,11 @@ acpi_pci_bind_root(struct acpi_device *dreturn -EINVAL ; } - data =kmalloc (sizeof (struct acpi_pci_data ),GFP_KERNEL ); + data =kzalloc (sizeof (struct acpi_pci_data ),GFP_KERNEL );if (!data) {kfree (pathname);return -ENOMEM ; } -memset (data,0 ,sizeof (struct acpi_pci_data )); data->id = *id; data->bus = bus;diff -puN
drivers/acpi/pci_irq.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/pci_irq.cdrivers/acpi/pci_irq.c renamed from drivers/acpi/pci_irq.c~acpi-replace-kmallocmemset-with-kzalloc +3
-6@@ -89,10 +89,9 @@ acpi_pci_irq_add_entry(acpi_handle handlif (!prt)return -EINVAL ; - entry =kmalloc (sizeof (struct acpi_prt_entry ),GFP_KERNEL ); + entry =kzalloc (sizeof (struct acpi_prt_entry ),GFP_KERNEL );if (!entry)return -ENOMEM ; -memset (entry,0 ,sizeof (struct acpi_prt_entry )); entry->id.segment = segment; entry->id.bus = bus;@@ -161,10 +160,9 @@ int acpi_pci_irq_add_prt(acpi_handle hanstatic int first_time =1 ; - pathname =kmalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL ); + pathname =kzalloc (ACPI_PATHNAME_MAX ,GFP_KERNEL );if (!pathname)return -ENOMEM ; -memset (pathname,0 ,ACPI_PATHNAME_MAX );if (first_time) { acpi_prt.count =0 ;@@ -198,11 +196,10 @@ int acpi_pci_irq_add_prt(acpi_handle hanreturn -ENODEV ; } - prt =kmalloc (buffer.length,GFP_KERNEL ); + prt =kzalloc (buffer.length,GFP_KERNEL );if (!prt) {return -ENOMEM ; } -memset (prt,0 , buffer.length); buffer.pointer = prt; status =acpi_get_irq_routing_table (handle, &buffer);diff -puN
drivers/acpi/pci_link.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/pci_link.cdrivers/acpi/pci_link.c renamed from drivers/acpi/pci_link.c~acpi-replace-kmallocmemset-with-kzalloc +2
-4@@ -307,11 +307,10 @@ static int acpi_pci_link_set(struct acpiif (!link || !irq)return -EINVAL ; - resource =kmalloc (sizeof (*resource) +1 ,irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL ); + resource =kzalloc (sizeof (*resource) +1 ,irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL );if (!resource)return -ENOMEM ; -memset (resource,0 ,sizeof (*resource) +1 ); buffer.length =sizeof (*resource) +1 ; buffer.pointer = resource;@@ -718,10 +717,9 @@ static int acpi_pci_link_add(struct acpiif (!device)return -EINVAL ; - link =kmalloc (sizeof (struct acpi_pci_link ),GFP_KERNEL ); + link =kzalloc (sizeof (struct acpi_pci_link ),GFP_KERNEL );if (!link)return -ENOMEM ; -memset (link,0 ,sizeof (struct acpi_pci_link )); link->device = device;strcpy (acpi_device_name (device),ACPI_PCI_LINK_DEVICE_NAME );diff -puN
drivers/acpi/pci_root.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/pci_root.cdrivers/acpi/pci_root.c renamed from drivers/acpi/pci_root.c~acpi-replace-kmallocmemset-with-kzalloc +1
-2@@ -165,10 +165,9 @@ static int acpi_pci_root_add(struct acpiif (!device)return -EINVAL ; - root =kmalloc (sizeof (struct acpi_pci_root ),GFP_KERNEL ); + root =kzalloc (sizeof (struct acpi_pci_root ),GFP_KERNEL );if (!root)return -ENOMEM ; -memset (root,0 ,sizeof (struct acpi_pci_root ));INIT_LIST_HEAD (&root->node); root->device = device;diff -puN
drivers/acpi/power.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/power.cdrivers/acpi/power.c renamed from drivers/acpi/power.c~acpi-replace-kmallocmemset-with-kzalloc +1
-2@@ -532,10 +532,9 @@ static int acpi_power_add(struct acpi_deif (!device)return -EINVAL ; - resource =kmalloc (sizeof (struct acpi_power_resource ),GFP_KERNEL ); + resource =kzalloc (sizeof (struct acpi_power_resource ),GFP_KERNEL );if (!resource)return -ENOMEM ; -memset (resource,0 ,sizeof (struct acpi_power_resource )); resource->device = device;strcpy (resource->name, device->pnp.bus_id);diff -puN
drivers/acpi/processor_core.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/processor_core.cdrivers/acpi/processor_core.c renamed from drivers/acpi/processor_core.c~acpi-replace-kmallocmemset-with-kzalloc +1
-2@@ -615,10 +615,9 @@ static int acpi_processor_add(struct acpif (!device)return -EINVAL ; - pr =kmalloc (sizeof (struct acpi_processor ),GFP_KERNEL ); + pr =kzalloc (sizeof (struct acpi_processor ),GFP_KERNEL );if (!pr)return -ENOMEM ; -memset (pr,0 ,sizeof (struct acpi_processor )); pr->handle = device->handle;strcpy (acpi_device_name (device),ACPI_PROCESSOR_DEVICE_NAME );diff -puN
drivers/acpi/sbs.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/sbs.cdrivers/acpi/sbs.c renamed from drivers/acpi/sbs.c~acpi-replace-kmallocmemset-with-kzalloc +1
-2@@ -1576,12 +1576,11 @@ static int acpi_sbs_add(struct acpi_deviint id, cnt;acpi_status status =AE_OK ; - sbs =kmalloc (sizeof (struct acpi_sbs ),GFP_KERNEL ); + sbs =kzalloc (sizeof (struct acpi_sbs ),GFP_KERNEL );if (!sbs) {ACPI_DEBUG_PRINT ((ACPI_DB_ERROR ,"kmalloc() failed\n" ));return -ENOMEM ; } -memset (sbs,0 ,sizeof (struct acpi_sbs )); cnt =0 ;while (cnt <10 ) {diff -puN
drivers/acpi/scan.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/scan.cdrivers/acpi/scan.c renamed from drivers/acpi/scan.c~acpi-replace-kmallocmemset-with-kzalloc +1
-2@@ -984,12 +984,11 @@ acpi_add_single_object(struct acpi_devicif (!child)return -EINVAL ; - device =kmalloc (sizeof (struct acpi_device ),GFP_KERNEL ); + device =kzalloc (sizeof (struct acpi_device ),GFP_KERNEL );if (!device) { printk(KERN_ERR PREFIX "Memory allocation error\n");return -ENOMEM ; } -memset (device,0 ,sizeof (struct acpi_device )); device->handle = handle; device->parent = parent;diff -puN
drivers/acpi/thermal.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/thermal.cdrivers/acpi/thermal.c renamed from drivers/acpi/thermal.c~acpi-replace-kmallocmemset-with-kzalloc +2
-5@@ -902,12 +902,10 @@ acpi_thermal_write_trip_points(struct fiint i =0 ; - limit_string =kmalloc (ACPI_THERMAL_MAX_LIMIT_STR_LEN ,GFP_KERNEL ); + limit_string =kzalloc (ACPI_THERMAL_MAX_LIMIT_STR_LEN ,GFP_KERNEL );if (!limit_string)return -ENOMEM ; -memset (limit_string,0 ,ACPI_THERMAL_MAX_LIMIT_STR_LEN ); - active =kmalloc (ACPI_THERMAL_MAX_ACTIVE *sizeof (int ),GFP_KERNEL );if (!active) {kfree (limit_string);@@ -1271,10 +1269,9 @@ static int acpi_thermal_add(struct acpi_if (!device)return -EINVAL ; - tz =kmalloc (sizeof (struct acpi_thermal ),GFP_KERNEL ); + tz =kzalloc (sizeof (struct acpi_thermal ),GFP_KERNEL );if (!tz)return -ENOMEM ; -memset (tz,0 ,sizeof (struct acpi_thermal )); tz->device = device;strcpy (tz->name, device->pnp.bus_id);diff -puN
drivers/acpi/utils.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/utils.cdrivers/acpi/utils.c renamed from drivers/acpi/utils.c~acpi-replace-kmallocmemset-with-kzalloc +2
-4@@ -262,11 +262,10 @@ acpi_evaluate_integer(acpi_handle handleif (!data)return AE_BAD_PARAMETER ; - element =kmalloc (sizeof (union acpi_object ),irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL ); + element =kzalloc (sizeof (union acpi_object ),irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL );if (!element)return AE_NO_MEMORY ; -memset (element,0 ,sizeof (union acpi_object )); buffer.length =sizeof (union acpi_object ); buffer.pointer = element; status =acpi_evaluate_object (handle, pathname, arguments, &buffer);@@ -321,12 +320,11 @@ acpi_evaluate_string(acpi_handle handle,return AE_BAD_DATA ; } - *data =kmalloc (element->string.length +1 ,GFP_KERNEL ); + *data =kzalloc (element->string.length +1 ,GFP_KERNEL );if (!data) { printk(KERN_ERR PREFIX "Memory allocation\n");return -ENOMEM ; } -memset (*data,0 , element->string.length +1 );memcpy (*data, element->string.pointer, element->string.length);diff -puN
drivers/acpi/video.c~acpi-replace-kmallocmemset-with-kzallocdrivers/acpi/video.cdrivers/acpi/video.c renamed from drivers/acpi/video.c~acpi-replace-kmallocmemset-with-kzalloc +3
-7@@ -532,11 +532,10 @@ static void acpi_video_device_find_cap(sint 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)@@ -1259,12 +1258,10 @@ acpi_video_bus_get_one_device(struct acpacpi_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;@@ -1691,10 +1688,9 @@ static int acpi_video_bus_add(struct acpif (!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 );diff -puN
drivers/pci/hotplug/acpiphp_ibm.c~acpi-replace-kmallocmemset-with-kzallocdrivers/pci/hotplug/acpiphp_ibm.cdrivers/pci/hotplug/acpiphp_ibm.c renamed from drivers/pci/hotplug/acpiphp_ibm.c~acpi-replace-kmallocmemset-with-kzalloc +1
-2@@ -319,13 +319,12 @@ static int ibm_get_table_from_acpi(charif (bufp ==NULL ) goto read_table_done; - lbuf =kmalloc (size,GFP_KERNEL ); + lbuf =kzalloc (size,GFP_KERNEL );dbg ("%s: element count: %i, ASL table size: %i, &table = 0x%p\n" , __FUNCTION__, package->package.count, size, lbuf);if (lbuf) { *bufp = lbuf; -memset (lbuf,0 , size); }else { size = -ENOMEM ; goto read_table_done;_
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 2 lines · On Wed, 20 Dec 2006 00:43:19 -0500 Len Brown <[email protected]> wrote:
Cleanup patches like this make it very difficult to work with -mm, as they conflict with just about every possible change.
hm, I'm a little surprised - I maintain the patch so it applies against your tree. I guess you have other stuff outstanding.
Quoted 11 lines
This means that if I don't apply patches in the same order as Andrew's quilt series, then I've got merge hell. And experience shows that there is a 0% chance that I can apply patches in the order that -mm does.
All this, for zero functional benefit.
Andrew, please do not accept cleanup patches in -mm that touch ACPI files. It would be easier if they were sent to me and I got to choose when the "flag days" occur based on what other patches are in the queue to Linus.
It _was_ sent to you - I just sent it ;)
In future I'll stage patches like this at the tail of the -mm acpi queue so the more substantive things don't get tangled up with it.
Len Brown
reviewerQuoted 2 lines · Len Brown
Cleanup patches like this make it very difficult to work with -mm, as they conflict with just about every possible change.
...
Quoted 4 lines
Andrew, please do not accept cleanup patches in -mm that touch ACPI files. It would be easier if they were sent to me and I got to choose when the "flag days" occur based on what other patches are in the queue to Linus.
That said, this one is applied.
thanks,
-Len