aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/acpi_memhotplug.c12
-rw-r--r--drivers/char/hpet.c5
2 files changed, 6 insertions, 11 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
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index ef140ebde117..07473cd84121 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -925,11 +925,8 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
925 status = acpi_resource_to_address64(res, &addr); 925 status = acpi_resource_to_address64(res, &addr);
926 926
927 if (ACPI_SUCCESS(status)) { 927 if (ACPI_SUCCESS(status)) {
928 unsigned long size;
929
930 size = addr.maximum - addr.minimum + 1;
931 hdp->hd_phys_address = addr.minimum; 928 hdp->hd_phys_address = addr.minimum;
932 hdp->hd_address = ioremap(addr.minimum, size); 929 hdp->hd_address = ioremap(addr.minimum, addr.address_length);
933 930
934 if (hpet_is_known(hdp)) { 931 if (hpet_is_known(hdp)) {
935 printk(KERN_DEBUG "%s: 0x%lx is busy\n", 932 printk(KERN_DEBUG "%s: 0x%lx is busy\n",