aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpi_memhotplug.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index d882bf87fa96..e0a95ba72371 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -74,7 +74,7 @@ struct acpi_memory_device {
74 unsigned short caching; /* memory cache attribute */ 74 unsigned short caching; /* memory cache attribute */
75 unsigned short write_protect; /* memory read/write attribute */ 75 unsigned short write_protect; /* memory read/write attribute */
76 u64 start_addr; /* Memory Range start physical addr */ 76 u64 start_addr; /* Memory Range start physical addr */
77 u64 end_addr; /* Memory Range end physical addr */ 77 u64 length; /* Memory Range length */
78}; 78};
79 79
80static int 80static int
@@ -97,12 +97,11 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
97 if (ACPI_SUCCESS(status)) { 97 if (ACPI_SUCCESS(status)) {
98 if (address64.resource_type == ACPI_MEMORY_RANGE) { 98 if (address64.resource_type == ACPI_MEMORY_RANGE) {
99 /* Populate the structure */ 99 /* Populate the structure */
100 mem_device->caching = 100 mem_device->caching = address64.info.mem.caching;
101 address64.info.mem.caching;
102 mem_device->write_protect = 101 mem_device->write_protect =
103 address64.info.mem.write_protect; 102 address64.info.mem.write_protect;
104 mem_device->start_addr = address64.minimum; 103 mem_device->start_addr = address64.minimum;
105 mem_device->end_addr = address64.maximum; 104 mem_device->length = address64.address_length;
106 } 105 }
107 } 106 }
108 107
@@ -199,8 +198,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
199 * Tell the VM there is more memory here... 198 * Tell the VM there is more memory here...
200 * Note: Assume that this function returns zero on success 199 * Note: Assume that this function returns zero on success
201 */ 200 */
202 result = add_memory(mem_device->start_addr, 201 result = add_memory(mem_device->start_addr, mem_device->length);
203 (mem_device->end_addr - mem_device->start_addr) + 1);
204 if (result) { 202 if (result) {
205 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n")); 203 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n"));
206 mem_device->state = MEMORY_INVALID_STATE; 204 mem_device->state = MEMORY_INVALID_STATE;
@@ -249,7 +247,7 @@ static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
249{ 247{
250 int result; 248 int result;
251 u64 start = mem_device->start_addr; 249 u64 start = mem_device->start_addr;
252 u64 len = mem_device->end_addr - start + 1; 250 u64 len = mem_device->length;
253 251
254 ACPI_FUNCTION_TRACE("acpi_memory_disable_device"); 252 ACPI_FUNCTION_TRACE("acpi_memory_disable_device");
255 253