diff options
Diffstat (limited to 'drivers/acpi/acpica/rsutils.c')
-rw-r--r-- | drivers/acpi/acpica/rsutils.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c index 9486992edbb8..cf06e49cd91c 100644 --- a/drivers/acpi/acpica/rsutils.c +++ b/drivers/acpi/acpica/rsutils.c | |||
@@ -5,7 +5,7 @@ | |||
5 | ******************************************************************************/ | 5 | ******************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2015, Intel Corp. | 8 | * Copyright (C) 2000 - 2016, Intel Corp. |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -221,14 +221,13 @@ acpi_rs_set_resource_length(acpi_rsdesc_size total_length, | |||
221 | ACPI_MOVE_16_TO_16(&aml->large_header.resource_length, | 221 | ACPI_MOVE_16_TO_16(&aml->large_header.resource_length, |
222 | &resource_length); | 222 | &resource_length); |
223 | } else { | 223 | } else { |
224 | /* Small descriptor -- bits 2:0 of byte 0 contain the length */ | 224 | /* |
225 | 225 | * Small descriptor -- bits 2:0 of byte 0 contain the length | |
226 | * Clear any existing length, preserving descriptor type bits | ||
227 | */ | ||
226 | aml->small_header.descriptor_type = (u8) | 228 | aml->small_header.descriptor_type = (u8) |
227 | 229 | ((aml->small_header.descriptor_type & | |
228 | /* Clear any existing length, preserving descriptor type bits */ | 230 | ~ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK) |
229 | ((aml->small_header. | ||
230 | descriptor_type & ~ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK) | ||
231 | |||
232 | | resource_length); | 231 | | resource_length); |
233 | } | 232 | } |
234 | } | 233 | } |
@@ -333,8 +332,8 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length, | |||
333 | aml_resource_source = ACPI_ADD_PTR(u8, aml, minimum_length); | 332 | aml_resource_source = ACPI_ADD_PTR(u8, aml, minimum_length); |
334 | 333 | ||
335 | /* | 334 | /* |
336 | * resource_source is present if the length of the descriptor is longer than | 335 | * resource_source is present if the length of the descriptor is longer |
337 | * the minimum length. | 336 | * than the minimum length. |
338 | * | 337 | * |
339 | * Note: Some resource descriptors will have an additional null, so | 338 | * Note: Some resource descriptors will have an additional null, so |
340 | * we add 1 to the minimum length. | 339 | * we add 1 to the minimum length. |
@@ -366,6 +365,7 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length, | |||
366 | total_length = | 365 | total_length = |
367 | (u32)strlen(ACPI_CAST_PTR(char, &aml_resource_source[1])) + | 366 | (u32)strlen(ACPI_CAST_PTR(char, &aml_resource_source[1])) + |
368 | 1; | 367 | 1; |
368 | |||
369 | total_length = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(total_length); | 369 | total_length = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(total_length); |
370 | 370 | ||
371 | memset(resource_source->string_ptr, 0, total_length); | 371 | memset(resource_source->string_ptr, 0, total_length); |
@@ -438,8 +438,8 @@ acpi_rs_set_resource_source(union aml_resource * aml, | |||
438 | * Add the length of the string (+ 1 for null terminator) to the | 438 | * Add the length of the string (+ 1 for null terminator) to the |
439 | * final descriptor length | 439 | * final descriptor length |
440 | */ | 440 | */ |
441 | descriptor_length += | 441 | descriptor_length += ((acpi_rsdesc_size) |
442 | ((acpi_rsdesc_size) resource_source->string_length + 1); | 442 | resource_source->string_length + 1); |
443 | } | 443 | } |
444 | 444 | ||
445 | /* Return the new total length of the AML descriptor */ | 445 | /* Return the new total length of the AML descriptor */ |
@@ -478,8 +478,9 @@ acpi_rs_get_prt_method_data(struct acpi_namespace_node * node, | |||
478 | 478 | ||
479 | /* Execute the method, no parameters */ | 479 | /* Execute the method, no parameters */ |
480 | 480 | ||
481 | status = acpi_ut_evaluate_object(node, METHOD_NAME__PRT, | 481 | status = |
482 | ACPI_BTYPE_PACKAGE, &obj_desc); | 482 | acpi_ut_evaluate_object(node, METHOD_NAME__PRT, ACPI_BTYPE_PACKAGE, |
483 | &obj_desc); | ||
483 | if (ACPI_FAILURE(status)) { | 484 | if (ACPI_FAILURE(status)) { |
484 | return_ACPI_STATUS(status); | 485 | return_ACPI_STATUS(status); |
485 | } | 486 | } |
@@ -527,8 +528,9 @@ acpi_rs_get_crs_method_data(struct acpi_namespace_node *node, | |||
527 | 528 | ||
528 | /* Execute the method, no parameters */ | 529 | /* Execute the method, no parameters */ |
529 | 530 | ||
530 | status = acpi_ut_evaluate_object(node, METHOD_NAME__CRS, | 531 | status = |
531 | ACPI_BTYPE_BUFFER, &obj_desc); | 532 | acpi_ut_evaluate_object(node, METHOD_NAME__CRS, ACPI_BTYPE_BUFFER, |
533 | &obj_desc); | ||
532 | if (ACPI_FAILURE(status)) { | 534 | if (ACPI_FAILURE(status)) { |
533 | return_ACPI_STATUS(status); | 535 | return_ACPI_STATUS(status); |
534 | } | 536 | } |
@@ -577,8 +579,9 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node, | |||
577 | 579 | ||
578 | /* Execute the method, no parameters */ | 580 | /* Execute the method, no parameters */ |
579 | 581 | ||
580 | status = acpi_ut_evaluate_object(node, METHOD_NAME__PRS, | 582 | status = |
581 | ACPI_BTYPE_BUFFER, &obj_desc); | 583 | acpi_ut_evaluate_object(node, METHOD_NAME__PRS, ACPI_BTYPE_BUFFER, |
584 | &obj_desc); | ||
582 | if (ACPI_FAILURE(status)) { | 585 | if (ACPI_FAILURE(status)) { |
583 | return_ACPI_STATUS(status); | 586 | return_ACPI_STATUS(status); |
584 | } | 587 | } |
@@ -627,8 +630,9 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, | |||
627 | 630 | ||
628 | /* Execute the method, no parameters */ | 631 | /* Execute the method, no parameters */ |
629 | 632 | ||
630 | status = acpi_ut_evaluate_object(node, METHOD_NAME__AEI, | 633 | status = |
631 | ACPI_BTYPE_BUFFER, &obj_desc); | 634 | acpi_ut_evaluate_object(node, METHOD_NAME__AEI, ACPI_BTYPE_BUFFER, |
635 | &obj_desc); | ||
632 | if (ACPI_FAILURE(status)) { | 636 | if (ACPI_FAILURE(status)) { |
633 | return_ACPI_STATUS(status); | 637 | return_ACPI_STATUS(status); |
634 | } | 638 | } |