diff options
Diffstat (limited to 'drivers/acpi/executer/exstoren.c')
-rw-r--r-- | drivers/acpi/executer/exstoren.c | 121 |
1 files changed, 61 insertions, 60 deletions
diff --git a/drivers/acpi/executer/exstoren.c b/drivers/acpi/executer/exstoren.c index 433588ab432..382f63c14ea 100644 --- a/drivers/acpi/executer/exstoren.c +++ b/drivers/acpi/executer/exstoren.c @@ -43,15 +43,12 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include <acpi/acpi.h> #include <acpi/acinterp.h> #include <acpi/amlcode.h> - #define _COMPONENT ACPI_EXECUTER - ACPI_MODULE_NAME ("exstoren") - +ACPI_MODULE_NAME("exstoren") /******************************************************************************* * @@ -67,19 +64,15 @@ * it and return the actual object in the source_desc_ptr. * ******************************************************************************/ - acpi_status -acpi_ex_resolve_object ( - union acpi_operand_object **source_desc_ptr, - acpi_object_type target_type, - struct acpi_walk_state *walk_state) +acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr, + acpi_object_type target_type, + struct acpi_walk_state *walk_state) { - union acpi_operand_object *source_desc = *source_desc_ptr; - acpi_status status = AE_OK; - - - ACPI_FUNCTION_TRACE ("ex_resolve_object"); + union acpi_operand_object *source_desc = *source_desc_ptr; + acpi_status status = AE_OK; + ACPI_FUNCTION_TRACE("ex_resolve_object"); /* Ensure we have a Target that can be stored to */ @@ -102,11 +95,14 @@ acpi_ex_resolve_object ( * are all essentially the same. This case handles the * "interchangeable" types Integer, String, and Buffer. */ - if (ACPI_GET_OBJECT_TYPE (source_desc) == ACPI_TYPE_LOCAL_REFERENCE) { + if (ACPI_GET_OBJECT_TYPE(source_desc) == + ACPI_TYPE_LOCAL_REFERENCE) { /* Resolve a reference object first */ - status = acpi_ex_resolve_to_value (source_desc_ptr, walk_state); - if (ACPI_FAILURE (status)) { + status = + acpi_ex_resolve_to_value(source_desc_ptr, + walk_state); + if (ACPI_FAILURE(status)) { break; } } @@ -119,31 +115,32 @@ acpi_ex_resolve_object ( /* Must have a Integer, Buffer, or String */ - if ((ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_INTEGER) && - (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_BUFFER) && - (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_TYPE_STRING) && - !((ACPI_GET_OBJECT_TYPE (source_desc) == ACPI_TYPE_LOCAL_REFERENCE) && (source_desc->reference.opcode == AML_LOAD_OP))) { + if ((ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_INTEGER) && + (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_BUFFER) && + (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_STRING) && + !((ACPI_GET_OBJECT_TYPE(source_desc) == + ACPI_TYPE_LOCAL_REFERENCE) + && (source_desc->reference.opcode == AML_LOAD_OP))) { /* Conversion successful but still not a valid type */ - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Cannot assign type %s to %s (must be type Int/Str/Buf)\n", - acpi_ut_get_object_type_name (source_desc), - acpi_ut_get_type_name (target_type))); + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Cannot assign type %s to %s (must be type Int/Str/Buf)\n", + acpi_ut_get_object_type_name + (source_desc), + acpi_ut_get_type_name(target_type))); status = AE_AML_OPERAND_TYPE; } break; - case ACPI_TYPE_LOCAL_ALIAS: case ACPI_TYPE_LOCAL_METHOD_ALIAS: /* Aliases are resolved by acpi_ex_prep_operands */ - ACPI_REPORT_ERROR (("Store into Alias - should never happen\n")); + ACPI_REPORT_ERROR(("Store into Alias - should never happen\n")); status = AE_AML_INTERNAL; break; - case ACPI_TYPE_PACKAGE: default: @@ -154,10 +151,9 @@ acpi_ex_resolve_object ( break; } - return_ACPI_STATUS (status); + return_ACPI_STATUS(status); } - /******************************************************************************* * * FUNCTION: acpi_ex_store_object_to_object @@ -194,18 +190,15 @@ acpi_ex_resolve_object ( ******************************************************************************/ acpi_status -acpi_ex_store_object_to_object ( - union acpi_operand_object *source_desc, - union acpi_operand_object *dest_desc, - union acpi_operand_object **new_desc, - struct acpi_walk_state *walk_state) +acpi_ex_store_object_to_object(union acpi_operand_object *source_desc, + union acpi_operand_object *dest_desc, + union acpi_operand_object **new_desc, + struct acpi_walk_state *walk_state) { - union acpi_operand_object *actual_src_desc; - acpi_status status = AE_OK; - - - ACPI_FUNCTION_TRACE_PTR ("ex_store_object_to_object", source_desc); + union acpi_operand_object *actual_src_desc; + acpi_status status = AE_OK; + ACPI_FUNCTION_TRACE_PTR("ex_store_object_to_object", source_desc); actual_src_desc = source_desc; if (!dest_desc) { @@ -214,11 +207,14 @@ acpi_ex_store_object_to_object ( * package element), so we can simply copy the source object * creating a new destination object */ - status = acpi_ut_copy_iobject_to_iobject (actual_src_desc, new_desc, walk_state); - return_ACPI_STATUS (status); + status = + acpi_ut_copy_iobject_to_iobject(actual_src_desc, new_desc, + walk_state); + return_ACPI_STATUS(status); } - if (ACPI_GET_OBJECT_TYPE (source_desc) != ACPI_GET_OBJECT_TYPE (dest_desc)) { + if (ACPI_GET_OBJECT_TYPE(source_desc) != + ACPI_GET_OBJECT_TYPE(dest_desc)) { /* * The source type does not match the type of the destination. * Perform the "implicit conversion" of the source to the current type @@ -228,10 +224,13 @@ acpi_ex_store_object_to_object ( * Otherwise, actual_src_desc is a temporary object to hold the * converted object. */ - status = acpi_ex_convert_to_target_type (ACPI_GET_OBJECT_TYPE (dest_desc), - source_desc, &actual_src_desc, walk_state); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + status = + acpi_ex_convert_to_target_type(ACPI_GET_OBJECT_TYPE + (dest_desc), source_desc, + &actual_src_desc, + walk_state); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); } if (source_desc == actual_src_desc) { @@ -240,7 +239,7 @@ acpi_ex_store_object_to_object ( * new object. */ *new_desc = source_desc; - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS(AE_OK); } } @@ -248,38 +247,42 @@ acpi_ex_store_object_to_object ( * We now have two objects of identical types, and we can perform a * copy of the *value* of the source object. */ - switch (ACPI_GET_OBJECT_TYPE (dest_desc)) { + switch (ACPI_GET_OBJECT_TYPE(dest_desc)) { case ACPI_TYPE_INTEGER: dest_desc->integer.value = actual_src_desc->integer.value; /* Truncate value if we are executing from a 32-bit ACPI table */ - acpi_ex_truncate_for32bit_table (dest_desc); + acpi_ex_truncate_for32bit_table(dest_desc); break; case ACPI_TYPE_STRING: - status = acpi_ex_store_string_to_string (actual_src_desc, dest_desc); + status = + acpi_ex_store_string_to_string(actual_src_desc, dest_desc); break; case ACPI_TYPE_BUFFER: - status = acpi_ex_store_buffer_to_buffer (actual_src_desc, dest_desc); + status = + acpi_ex_store_buffer_to_buffer(actual_src_desc, dest_desc); break; case ACPI_TYPE_PACKAGE: - status = acpi_ut_copy_iobject_to_iobject (actual_src_desc, &dest_desc, - walk_state); + status = + acpi_ut_copy_iobject_to_iobject(actual_src_desc, &dest_desc, + walk_state); break; default: /* * All other types come here. */ - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Store into type %s not implemented\n", - acpi_ut_get_object_type_name (dest_desc))); + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Store into type %s not implemented\n", + acpi_ut_get_object_type_name(dest_desc))); status = AE_NOT_IMPLEMENTED; break; @@ -288,11 +291,9 @@ acpi_ex_store_object_to_object ( if (actual_src_desc != source_desc) { /* Delete the intermediate (temporary) source object */ - acpi_ut_remove_reference (actual_src_desc); + acpi_ut_remove_reference(actual_src_desc); } *new_desc = dest_desc; - return_ACPI_STATUS (status); + return_ACPI_STATUS(status); } - - |