aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resources/rsmisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/resources/rsmisc.c')
-rw-r--r--drivers/acpi/resources/rsmisc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/acpi/resources/rsmisc.c b/drivers/acpi/resources/rsmisc.c
index ed866cf1c6d2..faf6e106b785 100644
--- a/drivers/acpi/resources/rsmisc.c
+++ b/drivers/acpi/resources/rsmisc.c
@@ -81,9 +81,10 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
81 u16 item_count = 0; 81 u16 item_count = 0;
82 u16 temp16 = 0; 82 u16 temp16 = 0;
83 83
84 ACPI_FUNCTION_TRACE("rs_get_resource"); 84 ACPI_FUNCTION_TRACE(rs_convert_aml_to_resource);
85 85
86 if (((acpi_native_uint) resource) & 0x3) { 86 if (((acpi_native_uint) resource) & 0x3) {
87
87 /* Each internal resource struct is expected to be 32-bit aligned */ 88 /* Each internal resource struct is expected to be 32-bit aligned */
88 89
89 ACPI_WARNING((AE_INFO, 90 ACPI_WARNING((AE_INFO,
@@ -295,9 +296,11 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
295 296
296 exit: 297 exit:
297 if (!flags_mode) { 298 if (!flags_mode) {
298 /* Round the resource struct length up to the next 32-bit boundary */
299 299
300 resource->length = ACPI_ROUND_UP_to_32_bITS(resource->length); 300 /* Round the resource struct length up to the next boundary (32 or 64) */
301
302 resource->length =
303 (u32) ACPI_ROUND_UP_TO_NATIVE_WORD(resource->length);
301 } 304 }
302 return_ACPI_STATUS(AE_OK); 305 return_ACPI_STATUS(AE_OK);
303} 306}
@@ -329,7 +332,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
329 u16 temp16 = 0; 332 u16 temp16 = 0;
330 u16 item_count = 0; 333 u16 item_count = 0;
331 334
332 ACPI_FUNCTION_TRACE("rs_convert_resource_to_aml"); 335 ACPI_FUNCTION_TRACE(rs_convert_resource_to_aml);
333 336
334 /* 337 /*
335 * First table entry must be ACPI_RSC_INITxxx and must contain the 338 * First table entry must be ACPI_RSC_INITxxx and must contain the
@@ -535,6 +538,7 @@ if (((aml->irq.flags & 0x09) == 0x00) || ((aml->irq.flags & 0x09) == 0x09)) {
535 538
536resource->data.extended_irq.interrupt_count = temp8; 539resource->data.extended_irq.interrupt_count = temp8;
537if (temp8 < 1) { 540if (temp8 < 1) {
541
538 /* Must have at least one IRQ */ 542 /* Must have at least one IRQ */
539 543
540 return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH); 544 return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);