[PATCH] X86/acpi: remove redundant logic of acpi memory hotadd

From: Liu Jinsong
Date: Wed Nov 14 2012 - 05:52:06 EST


When memory hotadd, acpi_memory_enable_device has already been done
at drv->ops.add (acpi_memory_device_add), no need to do it again
at notify callback.

At acpi_memory_enable_device, acpi_memory_get_device_resources
is also a redundant action, since it has been done at drv->ops.add.

Signed-off-by: Liu Jinsong <jinsong.liu@xxxxxxxxx>
---
drivers/acpi/acpi_memhotplug.c | 17 -----------------
1 files changed, 0 insertions(+), 17 deletions(-)

diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.=
c
index 24c807f..a6489fd 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -220,15 +220,6 @@ static int acpi_memory_enable_device(struct acpi_memor=
y_device *mem_device)
struct acpi_memory_info *info;
int node;
=20
-
- /* Get the range from the _CRS */
- result =3D acpi_memory_get_device_resources(mem_device);
- if (result) {
- printk(KERN_ERR PREFIX "get_device_resources failed\n");
- mem_device->state =3D MEMORY_INVALID_STATE;
- return result;
- }
-
node =3D acpi_get_node(mem_device->device->handle);
/*
* Tell the VM there is more memory here...
@@ -357,14 +348,6 @@ static void acpi_memory_device_notify(acpi_handle hand=
le, u32 event, void *data)
break;
}
=20
- if (acpi_memory_check_device(mem_device))
- break;
-
- if (acpi_memory_enable_device(mem_device)) {
- printk(KERN_ERR PREFIX "Cannot enable memory device\n");
- break;
- }
-
ost_code =3D ACPI_OST_SC_SUCCESS;
break;
=20
--=20
1.7.1

--_002_DE8DF0795D48FD4CA783C40EC829233539DED4SHSMSX101ccrcorpi_
Content-Type: application/octet-stream;
name="0001-X86-acpi-remove-redundant-logic-of-acpi-memory-hotad.patch"
Content-Description: 0001-X86-acpi-remove-redundant-logic-of-acpi-memory-hotad.patch
Content-Disposition: attachment;
filename="0001-X86-acpi-remove-redundant-logic-of-acpi-memory-hotad.patch";
size=1705; creation-date="Wed, 14 Nov 2012 11:37:22 GM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WNwaV9tZW1vcnlf
ZW5hYmxlX2RldmljZShtZW1fZGV2aWNlKSkgewotCQkJcHJpbnRrKEtFUk5fRVJSIFBSRUZJWCAi
Q2Fubm90IGVuYWJsZSBtZW1vcnkgZGV2aWNlXG4iKTsKLQkJCWJyZWFrOwotCQl9Ci0KIAkJb3N0
X2NvZGUgPSBBQ1BJX09TVF9TQ19TVUNDRVNTOwogCQlicmVhazsKIAotLSAKMS43LjEKCg==

--_002_DE8DF0795D48FD4CA783C40EC829233539DED4SHSMSX101ccrcorpi_--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/