diff options
Diffstat (limited to 'drivers/acpi/namespace')
| -rw-r--r-- | drivers/acpi/namespace/nsdump.c | 6 | ||||
| -rw-r--r-- | drivers/acpi/namespace/nseval.c | 35 | ||||
| -rw-r--r-- | drivers/acpi/namespace/nsinit.c | 1 | ||||
| -rw-r--r-- | drivers/acpi/namespace/nsload.c | 3 | ||||
| -rw-r--r-- | drivers/acpi/namespace/nsparse.c | 15 | ||||
| -rw-r--r-- | drivers/acpi/namespace/nsutils.c | 50 | ||||
| -rw-r--r-- | drivers/acpi/namespace/nsxfeval.c | 3 |
7 files changed, 72 insertions, 41 deletions
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c index 5445751b8a3e..0ab22004728a 100644 --- a/drivers/acpi/namespace/nsdump.c +++ b/drivers/acpi/namespace/nsdump.c | |||
| @@ -73,7 +73,7 @@ acpi_ns_dump_one_device(acpi_handle obj_handle, | |||
| 73 | 73 | ||
| 74 | void acpi_ns_print_pathname(u32 num_segments, char *pathname) | 74 | void acpi_ns_print_pathname(u32 num_segments, char *pathname) |
| 75 | { | 75 | { |
| 76 | acpi_native_uint i; | 76 | u32 i; |
| 77 | 77 | ||
| 78 | ACPI_FUNCTION_NAME(ns_print_pathname); | 78 | ACPI_FUNCTION_NAME(ns_print_pathname); |
| 79 | 79 | ||
| @@ -515,12 +515,12 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, | |||
| 515 | 515 | ||
| 516 | if (obj_type > ACPI_TYPE_LOCAL_MAX) { | 516 | if (obj_type > ACPI_TYPE_LOCAL_MAX) { |
| 517 | acpi_os_printf | 517 | acpi_os_printf |
| 518 | ("(Ptr to ACPI Object type %X [UNKNOWN])\n", | 518 | ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n", |
| 519 | obj_type); | 519 | obj_type); |
| 520 | bytes_to_dump = 32; | 520 | bytes_to_dump = 32; |
| 521 | } else { | 521 | } else { |
| 522 | acpi_os_printf | 522 | acpi_os_printf |
| 523 | ("(Ptr to ACPI Object type %X [%s])\n", | 523 | ("(Pointer to ACPI Object type %.2X [%s])\n", |
| 524 | obj_type, acpi_ut_get_type_name(obj_type)); | 524 | obj_type, acpi_ut_get_type_name(obj_type)); |
| 525 | bytes_to_dump = | 525 | bytes_to_dump = |
| 526 | sizeof(union acpi_operand_object); | 526 | sizeof(union acpi_operand_object); |
diff --git a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c index 14bdfa92bea0..d369164e00b0 100644 --- a/drivers/acpi/namespace/nseval.c +++ b/drivers/acpi/namespace/nseval.c | |||
| @@ -138,6 +138,41 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info) | |||
| 138 | return_ACPI_STATUS(AE_NULL_OBJECT); | 138 | return_ACPI_STATUS(AE_NULL_OBJECT); |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | /* | ||
| 142 | * Calculate the number of arguments being passed to the method | ||
| 143 | */ | ||
| 144 | |||
| 145 | info->param_count = 0; | ||
| 146 | if (info->parameters) { | ||
| 147 | while (info->parameters[info->param_count]) | ||
| 148 | info->param_count++; | ||
| 149 | } | ||
| 150 | |||
| 151 | /* Error if too few arguments were passed in */ | ||
| 152 | |||
| 153 | if (info->param_count < info->obj_desc->method.param_count) { | ||
| 154 | ACPI_ERROR((AE_INFO, | ||
| 155 | "Insufficient arguments - " | ||
| 156 | "method [%4.4s] needs %d, found %d", | ||
| 157 | acpi_ut_get_node_name(info->resolved_node), | ||
| 158 | info->obj_desc->method.param_count, | ||
| 159 | info->param_count)); | ||
| 160 | return_ACPI_STATUS(AE_MISSING_ARGUMENTS); | ||
| 161 | } | ||
| 162 | |||
| 163 | /* Just a warning if too many arguments */ | ||
| 164 | |||
| 165 | else if (info->param_count > | ||
| 166 | info->obj_desc->method.param_count) { | ||
| 167 | ACPI_WARNING((AE_INFO, | ||
| 168 | "Excess arguments - " | ||
| 169 | "method [%4.4s] needs %d, found %d", | ||
| 170 | acpi_ut_get_node_name(info-> | ||
| 171 | resolved_node), | ||
| 172 | info->obj_desc->method.param_count, | ||
| 173 | info->param_count)); | ||
| 174 | } | ||
| 175 | |||
| 141 | ACPI_DUMP_PATHNAME(info->resolved_node, "Execute Method:", | 176 | ACPI_DUMP_PATHNAME(info->resolved_node, "Execute Method:", |
| 142 | ACPI_LV_INFO, _COMPONENT); | 177 | ACPI_LV_INFO, _COMPONENT); |
| 143 | 178 | ||
diff --git a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c index 6d6d930c8e18..e4c57510d798 100644 --- a/drivers/acpi/namespace/nsinit.c +++ b/drivers/acpi/namespace/nsinit.c | |||
| @@ -542,7 +542,6 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
| 542 | info->prefix_node = device_node; | 542 | info->prefix_node = device_node; |
| 543 | info->pathname = METHOD_NAME__INI; | 543 | info->pathname = METHOD_NAME__INI; |
| 544 | info->parameters = NULL; | 544 | info->parameters = NULL; |
| 545 | info->parameter_type = ACPI_PARAM_ARGS; | ||
| 546 | info->flags = ACPI_IGNORE_RETURN_VALUE; | 545 | info->flags = ACPI_IGNORE_RETURN_VALUE; |
| 547 | 546 | ||
| 548 | /* | 547 | /* |
diff --git a/drivers/acpi/namespace/nsload.c b/drivers/acpi/namespace/nsload.c index 2c92f6cf5ce1..a4a412b7c029 100644 --- a/drivers/acpi/namespace/nsload.c +++ b/drivers/acpi/namespace/nsload.c | |||
| @@ -71,8 +71,7 @@ static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle); | |||
| 71 | ******************************************************************************/ | 71 | ******************************************************************************/ |
| 72 | 72 | ||
| 73 | acpi_status | 73 | acpi_status |
| 74 | acpi_ns_load_table(acpi_native_uint table_index, | 74 | acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node) |
| 75 | struct acpi_namespace_node *node) | ||
| 76 | { | 75 | { |
| 77 | acpi_status status; | 76 | acpi_status status; |
| 78 | 77 | ||
diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c index 46a79b0103b6..a82271a9dbb3 100644 --- a/drivers/acpi/namespace/nsparse.c +++ b/drivers/acpi/namespace/nsparse.c | |||
| @@ -63,13 +63,13 @@ ACPI_MODULE_NAME("nsparse") | |||
| 63 | * | 63 | * |
| 64 | ******************************************************************************/ | 64 | ******************************************************************************/ |
| 65 | acpi_status | 65 | acpi_status |
| 66 | acpi_ns_one_complete_parse(acpi_native_uint pass_number, | 66 | acpi_ns_one_complete_parse(u32 pass_number, |
| 67 | acpi_native_uint table_index, | 67 | u32 table_index, |
| 68 | struct acpi_namespace_node * start_node) | 68 | struct acpi_namespace_node *start_node) |
| 69 | { | 69 | { |
| 70 | union acpi_parse_object *parse_root; | 70 | union acpi_parse_object *parse_root; |
| 71 | acpi_status status; | 71 | acpi_status status; |
| 72 | acpi_native_uint aml_length; | 72 | u32 aml_length; |
| 73 | u8 *aml_start; | 73 | u8 *aml_start; |
| 74 | struct acpi_walk_state *walk_state; | 74 | struct acpi_walk_state *walk_state; |
| 75 | struct acpi_table_header *table; | 75 | struct acpi_table_header *table; |
| @@ -112,8 +112,8 @@ acpi_ns_one_complete_parse(acpi_native_uint pass_number, | |||
| 112 | aml_start = (u8 *) table + sizeof(struct acpi_table_header); | 112 | aml_start = (u8 *) table + sizeof(struct acpi_table_header); |
| 113 | aml_length = table->length - sizeof(struct acpi_table_header); | 113 | aml_length = table->length - sizeof(struct acpi_table_header); |
| 114 | status = acpi_ds_init_aml_walk(walk_state, parse_root, NULL, | 114 | status = acpi_ds_init_aml_walk(walk_state, parse_root, NULL, |
| 115 | aml_start, (u32) aml_length, | 115 | aml_start, aml_length, NULL, |
| 116 | NULL, (u8) pass_number); | 116 | (u8) pass_number); |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | if (ACPI_FAILURE(status)) { | 119 | if (ACPI_FAILURE(status)) { |
| @@ -158,8 +158,7 @@ acpi_ns_one_complete_parse(acpi_native_uint pass_number, | |||
| 158 | ******************************************************************************/ | 158 | ******************************************************************************/ |
| 159 | 159 | ||
| 160 | acpi_status | 160 | acpi_status |
| 161 | acpi_ns_parse_table(acpi_native_uint table_index, | 161 | acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node) |
| 162 | struct acpi_namespace_node *start_node) | ||
| 163 | { | 162 | { |
| 164 | acpi_status status; | 163 | acpi_status status; |
| 165 | 164 | ||
diff --git a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c index 64c039843ed2..b0817e1127b1 100644 --- a/drivers/acpi/namespace/nsutils.c +++ b/drivers/acpi/namespace/nsutils.c | |||
| @@ -73,9 +73,9 @@ acpi_name acpi_ns_find_parent_name(struct acpi_namespace_node *node_to_search); | |||
| 73 | ******************************************************************************/ | 73 | ******************************************************************************/ |
| 74 | 74 | ||
| 75 | void | 75 | void |
| 76 | acpi_ns_report_error(char *module_name, | 76 | acpi_ns_report_error(const char *module_name, |
| 77 | u32 line_number, | 77 | u32 line_number, |
| 78 | char *internal_name, acpi_status lookup_status) | 78 | const char *internal_name, acpi_status lookup_status) |
| 79 | { | 79 | { |
| 80 | acpi_status status; | 80 | acpi_status status; |
| 81 | u32 bad_name; | 81 | u32 bad_name; |
| @@ -130,11 +130,11 @@ acpi_ns_report_error(char *module_name, | |||
| 130 | ******************************************************************************/ | 130 | ******************************************************************************/ |
| 131 | 131 | ||
| 132 | void | 132 | void |
| 133 | acpi_ns_report_method_error(char *module_name, | 133 | acpi_ns_report_method_error(const char *module_name, |
| 134 | u32 line_number, | 134 | u32 line_number, |
| 135 | char *message, | 135 | const char *message, |
| 136 | struct acpi_namespace_node *prefix_node, | 136 | struct acpi_namespace_node *prefix_node, |
| 137 | char *path, acpi_status method_status) | 137 | const char *path, acpi_status method_status) |
| 138 | { | 138 | { |
| 139 | acpi_status status; | 139 | acpi_status status; |
| 140 | struct acpi_namespace_node *node = prefix_node; | 140 | struct acpi_namespace_node *node = prefix_node; |
| @@ -167,7 +167,8 @@ acpi_ns_report_method_error(char *module_name, | |||
| 167 | ******************************************************************************/ | 167 | ******************************************************************************/ |
| 168 | 168 | ||
| 169 | void | 169 | void |
| 170 | acpi_ns_print_node_pathname(struct acpi_namespace_node *node, char *message) | 170 | acpi_ns_print_node_pathname(struct acpi_namespace_node *node, |
| 171 | const char *message) | ||
| 171 | { | 172 | { |
| 172 | struct acpi_buffer buffer; | 173 | struct acpi_buffer buffer; |
| 173 | acpi_status status; | 174 | acpi_status status; |
| @@ -296,7 +297,7 @@ u32 acpi_ns_local(acpi_object_type type) | |||
| 296 | 297 | ||
| 297 | void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info) | 298 | void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info) |
| 298 | { | 299 | { |
| 299 | char *next_external_char; | 300 | const char *next_external_char; |
| 300 | u32 i; | 301 | u32 i; |
| 301 | 302 | ||
| 302 | ACPI_FUNCTION_ENTRY(); | 303 | ACPI_FUNCTION_ENTRY(); |
| @@ -363,9 +364,9 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info) | |||
| 363 | { | 364 | { |
| 364 | u32 num_segments = info->num_segments; | 365 | u32 num_segments = info->num_segments; |
| 365 | char *internal_name = info->internal_name; | 366 | char *internal_name = info->internal_name; |
| 366 | char *external_name = info->next_external_char; | 367 | const char *external_name = info->next_external_char; |
| 367 | char *result = NULL; | 368 | char *result = NULL; |
| 368 | acpi_native_uint i; | 369 | u32 i; |
| 369 | 370 | ||
| 370 | ACPI_FUNCTION_TRACE(ns_build_internal_name); | 371 | ACPI_FUNCTION_TRACE(ns_build_internal_name); |
| 371 | 372 | ||
| @@ -400,12 +401,11 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info) | |||
| 400 | result = &internal_name[i]; | 401 | result = &internal_name[i]; |
| 401 | } else if (num_segments == 2) { | 402 | } else if (num_segments == 2) { |
| 402 | internal_name[i] = AML_DUAL_NAME_PREFIX; | 403 | internal_name[i] = AML_DUAL_NAME_PREFIX; |
| 403 | result = &internal_name[(acpi_native_uint) (i + 1)]; | 404 | result = &internal_name[(acpi_size) i + 1]; |
| 404 | } else { | 405 | } else { |
| 405 | internal_name[i] = AML_MULTI_NAME_PREFIX_OP; | 406 | internal_name[i] = AML_MULTI_NAME_PREFIX_OP; |
| 406 | internal_name[(acpi_native_uint) (i + 1)] = | 407 | internal_name[(acpi_size) i + 1] = (char)num_segments; |
| 407 | (char)num_segments; | 408 | result = &internal_name[(acpi_size) i + 2]; |
| 408 | result = &internal_name[(acpi_native_uint) (i + 2)]; | ||
| 409 | } | 409 | } |
| 410 | } | 410 | } |
| 411 | 411 | ||
| @@ -472,7 +472,8 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info) | |||
| 472 | * | 472 | * |
| 473 | *******************************************************************************/ | 473 | *******************************************************************************/ |
| 474 | 474 | ||
| 475 | acpi_status acpi_ns_internalize_name(char *external_name, char **converted_name) | 475 | acpi_status |
| 476 | acpi_ns_internalize_name(const char *external_name, char **converted_name) | ||
| 476 | { | 477 | { |
| 477 | char *internal_name; | 478 | char *internal_name; |
| 478 | struct acpi_namestring_info info; | 479 | struct acpi_namestring_info info; |
| @@ -528,15 +529,15 @@ acpi_status acpi_ns_internalize_name(char *external_name, char **converted_name) | |||
| 528 | 529 | ||
| 529 | acpi_status | 530 | acpi_status |
| 530 | acpi_ns_externalize_name(u32 internal_name_length, | 531 | acpi_ns_externalize_name(u32 internal_name_length, |
| 531 | char *internal_name, | 532 | const char *internal_name, |
| 532 | u32 * converted_name_length, char **converted_name) | 533 | u32 * converted_name_length, char **converted_name) |
| 533 | { | 534 | { |
| 534 | acpi_native_uint names_index = 0; | 535 | u32 names_index = 0; |
| 535 | acpi_native_uint num_segments = 0; | 536 | u32 num_segments = 0; |
| 536 | acpi_native_uint required_length; | 537 | u32 required_length; |
| 537 | acpi_native_uint prefix_length = 0; | 538 | u32 prefix_length = 0; |
| 538 | acpi_native_uint i = 0; | 539 | u32 i = 0; |
| 539 | acpi_native_uint j = 0; | 540 | u32 j = 0; |
| 540 | 541 | ||
| 541 | ACPI_FUNCTION_TRACE(ns_externalize_name); | 542 | ACPI_FUNCTION_TRACE(ns_externalize_name); |
| 542 | 543 | ||
| @@ -582,9 +583,8 @@ acpi_ns_externalize_name(u32 internal_name_length, | |||
| 582 | /* <count> 4-byte names */ | 583 | /* <count> 4-byte names */ |
| 583 | 584 | ||
| 584 | names_index = prefix_length + 2; | 585 | names_index = prefix_length + 2; |
| 585 | num_segments = (acpi_native_uint) (u8) | 586 | num_segments = (u8) |
| 586 | internal_name[(acpi_native_uint) | 587 | internal_name[(acpi_size) prefix_length + 1]; |
| 587 | (prefix_length + 1)]; | ||
| 588 | break; | 588 | break; |
| 589 | 589 | ||
| 590 | case AML_DUAL_NAME_PREFIX: | 590 | case AML_DUAL_NAME_PREFIX: |
| @@ -823,7 +823,7 @@ u32 acpi_ns_opens_scope(acpi_object_type type) | |||
| 823 | 823 | ||
| 824 | acpi_status | 824 | acpi_status |
| 825 | acpi_ns_get_node(struct acpi_namespace_node *prefix_node, | 825 | acpi_ns_get_node(struct acpi_namespace_node *prefix_node, |
| 826 | char *pathname, | 826 | const char *pathname, |
| 827 | u32 flags, struct acpi_namespace_node **return_node) | 827 | u32 flags, struct acpi_namespace_node **return_node) |
| 828 | { | 828 | { |
| 829 | union acpi_generic_state scope_info; | 829 | union acpi_generic_state scope_info; |
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c index a8d549187c84..38be5865d95d 100644 --- a/drivers/acpi/namespace/nsxfeval.c +++ b/drivers/acpi/namespace/nsxfeval.c | |||
| @@ -182,7 +182,6 @@ acpi_evaluate_object(acpi_handle handle, | |||
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | info->pathname = pathname; | 184 | info->pathname = pathname; |
| 185 | info->parameter_type = ACPI_PARAM_ARGS; | ||
| 186 | 185 | ||
| 187 | /* Convert and validate the device handle */ | 186 | /* Convert and validate the device handle */ |
| 188 | 187 | ||
| @@ -442,7 +441,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, | |||
| 442 | u32 flags; | 441 | u32 flags; |
| 443 | struct acpica_device_id hid; | 442 | struct acpica_device_id hid; |
| 444 | struct acpi_compatible_id_list *cid; | 443 | struct acpi_compatible_id_list *cid; |
| 445 | acpi_native_uint i; | 444 | u32 i; |
| 446 | int found; | 445 | int found; |
| 447 | 446 | ||
| 448 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); | 447 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); |
