diff options
Diffstat (limited to 'drivers/acpi/acpica/nspredef.c')
| -rw-r--r-- | drivers/acpi/acpica/nspredef.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c index 452703290d35..d9e8cbc6e679 100644 --- a/drivers/acpi/acpica/nspredef.c +++ b/drivers/acpi/acpica/nspredef.c | |||
| @@ -79,7 +79,9 @@ acpi_ns_check_package(char *pathname, | |||
| 79 | static acpi_status | 79 | static acpi_status |
| 80 | acpi_ns_check_package_elements(char *pathname, | 80 | acpi_ns_check_package_elements(char *pathname, |
| 81 | union acpi_operand_object **elements, | 81 | union acpi_operand_object **elements, |
| 82 | u8 type1, u32 count1, u8 type2, u32 count2); | 82 | u8 type1, |
| 83 | u32 count1, | ||
| 84 | u8 type2, u32 count2, u32 start_index); | ||
| 83 | 85 | ||
| 84 | static acpi_status | 86 | static acpi_status |
| 85 | acpi_ns_check_object_type(char *pathname, | 87 | acpi_ns_check_object_type(char *pathname, |
| @@ -221,7 +223,7 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node, | |||
| 221 | 223 | ||
| 222 | /* For returned Package objects, check the type of all sub-objects */ | 224 | /* For returned Package objects, check the type of all sub-objects */ |
| 223 | 225 | ||
| 224 | if (ACPI_GET_OBJECT_TYPE(return_object) == ACPI_TYPE_PACKAGE) { | 226 | if (return_object->common.type == ACPI_TYPE_PACKAGE) { |
| 225 | status = | 227 | status = |
| 226 | acpi_ns_check_package(pathname, return_object_ptr, | 228 | acpi_ns_check_package(pathname, return_object_ptr, |
| 227 | predefined); | 229 | predefined); |
| @@ -302,7 +304,8 @@ acpi_ns_check_parameter_count(char *pathname, | |||
| 302 | if ((user_param_count != required_params_current) && | 304 | if ((user_param_count != required_params_current) && |
| 303 | (user_param_count != required_params_old)) { | 305 | (user_param_count != required_params_old)) { |
| 304 | ACPI_WARNING((AE_INFO, | 306 | ACPI_WARNING((AE_INFO, |
| 305 | "%s: Parameter count mismatch - caller passed %d, ACPI requires %d", | 307 | "%s: Parameter count mismatch - " |
| 308 | "caller passed %d, ACPI requires %d", | ||
| 306 | pathname, user_param_count, | 309 | pathname, user_param_count, |
| 307 | required_params_current)); | 310 | required_params_current)); |
| 308 | } | 311 | } |
| @@ -472,7 +475,7 @@ acpi_ns_check_package(char *pathname, | |||
| 472 | package->ret_info. | 475 | package->ret_info. |
| 473 | object_type2, | 476 | object_type2, |
| 474 | package->ret_info. | 477 | package->ret_info. |
| 475 | count2); | 478 | count2, 0); |
| 476 | if (ACPI_FAILURE(status)) { | 479 | if (ACPI_FAILURE(status)) { |
| 477 | return (status); | 480 | return (status); |
| 478 | } | 481 | } |
| @@ -623,7 +626,7 @@ acpi_ns_check_package(char *pathname, | |||
| 623 | object_type2, | 626 | object_type2, |
| 624 | package-> | 627 | package-> |
| 625 | ret_info. | 628 | ret_info. |
| 626 | count2); | 629 | count2, 0); |
| 627 | if (ACPI_FAILURE(status)) { | 630 | if (ACPI_FAILURE(status)) { |
| 628 | return (status); | 631 | return (status); |
| 629 | } | 632 | } |
| @@ -672,7 +675,8 @@ acpi_ns_check_package(char *pathname, | |||
| 672 | object_type1, | 675 | object_type1, |
| 673 | sub_package-> | 676 | sub_package-> |
| 674 | package. | 677 | package. |
| 675 | count, 0, 0); | 678 | count, 0, 0, |
| 679 | 0); | ||
| 676 | if (ACPI_FAILURE(status)) { | 680 | if (ACPI_FAILURE(status)) { |
| 677 | return (status); | 681 | return (status); |
| 678 | } | 682 | } |
| @@ -710,7 +714,8 @@ acpi_ns_check_package(char *pathname, | |||
| 710 | ret_info. | 714 | ret_info. |
| 711 | object_type1, | 715 | object_type1, |
| 712 | (expected_count | 716 | (expected_count |
| 713 | - 1), 0, 0); | 717 | - 1), 0, 0, |
| 718 | 1); | ||
| 714 | if (ACPI_FAILURE(status)) { | 719 | if (ACPI_FAILURE(status)) { |
| 715 | return (status); | 720 | return (status); |
| 716 | } | 721 | } |
| @@ -758,6 +763,7 @@ acpi_ns_check_package(char *pathname, | |||
| 758 | * Count1 - Count for first group | 763 | * Count1 - Count for first group |
| 759 | * Type2 - Object type for second group | 764 | * Type2 - Object type for second group |
| 760 | * Count2 - Count for second group | 765 | * Count2 - Count for second group |
| 766 | * start_index - Start of the first group of elements | ||
| 761 | * | 767 | * |
| 762 | * RETURN: Status | 768 | * RETURN: Status |
| 763 | * | 769 | * |
| @@ -769,7 +775,9 @@ acpi_ns_check_package(char *pathname, | |||
| 769 | static acpi_status | 775 | static acpi_status |
| 770 | acpi_ns_check_package_elements(char *pathname, | 776 | acpi_ns_check_package_elements(char *pathname, |
| 771 | union acpi_operand_object **elements, | 777 | union acpi_operand_object **elements, |
| 772 | u8 type1, u32 count1, u8 type2, u32 count2) | 778 | u8 type1, |
| 779 | u32 count1, | ||
| 780 | u8 type2, u32 count2, u32 start_index) | ||
| 773 | { | 781 | { |
| 774 | union acpi_operand_object **this_element = elements; | 782 | union acpi_operand_object **this_element = elements; |
| 775 | acpi_status status; | 783 | acpi_status status; |
| @@ -782,7 +790,7 @@ acpi_ns_check_package_elements(char *pathname, | |||
| 782 | */ | 790 | */ |
| 783 | for (i = 0; i < count1; i++) { | 791 | for (i = 0; i < count1; i++) { |
| 784 | status = acpi_ns_check_object_type(pathname, this_element, | 792 | status = acpi_ns_check_object_type(pathname, this_element, |
| 785 | type1, i); | 793 | type1, i + start_index); |
| 786 | if (ACPI_FAILURE(status)) { | 794 | if (ACPI_FAILURE(status)) { |
| 787 | return (status); | 795 | return (status); |
| 788 | } | 796 | } |
| @@ -791,7 +799,8 @@ acpi_ns_check_package_elements(char *pathname, | |||
| 791 | 799 | ||
| 792 | for (i = 0; i < count2; i++) { | 800 | for (i = 0; i < count2; i++) { |
| 793 | status = acpi_ns_check_object_type(pathname, this_element, | 801 | status = acpi_ns_check_object_type(pathname, this_element, |
| 794 | type2, (i + count1)); | 802 | type2, |
| 803 | (i + count1 + start_index)); | ||
| 795 | if (ACPI_FAILURE(status)) { | 804 | if (ACPI_FAILURE(status)) { |
| 796 | return (status); | 805 | return (status); |
| 797 | } | 806 | } |
| @@ -858,7 +867,7 @@ acpi_ns_check_object_type(char *pathname, | |||
| 858 | * from all of the predefined names (including elements of returned | 867 | * from all of the predefined names (including elements of returned |
| 859 | * packages) | 868 | * packages) |
| 860 | */ | 869 | */ |
| 861 | switch (ACPI_GET_OBJECT_TYPE(return_object)) { | 870 | switch (return_object->common.type) { |
| 862 | case ACPI_TYPE_INTEGER: | 871 | case ACPI_TYPE_INTEGER: |
| 863 | return_btype = ACPI_RTYPE_INTEGER; | 872 | return_btype = ACPI_RTYPE_INTEGER; |
| 864 | break; | 873 | break; |
| @@ -901,7 +910,7 @@ acpi_ns_check_object_type(char *pathname, | |||
| 901 | 910 | ||
| 902 | /* For reference objects, check that the reference type is correct */ | 911 | /* For reference objects, check that the reference type is correct */ |
| 903 | 912 | ||
| 904 | if (ACPI_GET_OBJECT_TYPE(return_object) == ACPI_TYPE_LOCAL_REFERENCE) { | 913 | if (return_object->common.type == ACPI_TYPE_LOCAL_REFERENCE) { |
| 905 | status = acpi_ns_check_reference(pathname, return_object); | 914 | status = acpi_ns_check_reference(pathname, return_object); |
| 906 | } | 915 | } |
| 907 | 916 | ||
| @@ -974,7 +983,8 @@ acpi_ns_check_reference(char *pathname, | |||
| 974 | } | 983 | } |
| 975 | 984 | ||
| 976 | ACPI_WARNING((AE_INFO, | 985 | ACPI_WARNING((AE_INFO, |
| 977 | "%s: Return type mismatch - unexpected reference object type [%s] %2.2X", | 986 | "%s: Return type mismatch - " |
| 987 | "unexpected reference object type [%s] %2.2X", | ||
| 978 | pathname, acpi_ut_get_reference_name(return_object), | 988 | pathname, acpi_ut_get_reference_name(return_object), |
| 979 | return_object->reference.class)); | 989 | return_object->reference.class)); |
| 980 | 990 | ||
| @@ -1006,7 +1016,7 @@ acpi_ns_repair_object(u32 expected_btypes, | |||
| 1006 | union acpi_operand_object *new_object; | 1016 | union acpi_operand_object *new_object; |
| 1007 | acpi_size length; | 1017 | acpi_size length; |
| 1008 | 1018 | ||
| 1009 | switch (ACPI_GET_OBJECT_TYPE(return_object)) { | 1019 | switch (return_object->common.type) { |
| 1010 | case ACPI_TYPE_BUFFER: | 1020 | case ACPI_TYPE_BUFFER: |
| 1011 | 1021 | ||
| 1012 | if (!(expected_btypes & ACPI_RTYPE_STRING)) { | 1022 | if (!(expected_btypes & ACPI_RTYPE_STRING)) { |
