diff options
Diffstat (limited to 'drivers/acpi/acpica/utcopy.c')
-rw-r--r-- | drivers/acpi/acpica/utcopy.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c index b0dcfd3c872a..919624f123d5 100644 --- a/drivers/acpi/acpica/utcopy.c +++ b/drivers/acpi/acpica/utcopy.c | |||
@@ -135,11 +135,11 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object, | |||
135 | * In general, the external object will be the same type as | 135 | * In general, the external object will be the same type as |
136 | * the internal object | 136 | * the internal object |
137 | */ | 137 | */ |
138 | external_object->type = ACPI_GET_OBJECT_TYPE(internal_object); | 138 | external_object->type = internal_object->common.type; |
139 | 139 | ||
140 | /* However, only a limited number of external types are supported */ | 140 | /* However, only a limited number of external types are supported */ |
141 | 141 | ||
142 | switch (ACPI_GET_OBJECT_TYPE(internal_object)) { | 142 | switch (internal_object->common.type) { |
143 | case ACPI_TYPE_STRING: | 143 | case ACPI_TYPE_STRING: |
144 | 144 | ||
145 | external_object->string.pointer = (char *)data_space; | 145 | external_object->string.pointer = (char *)data_space; |
@@ -222,8 +222,8 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object, | |||
222 | */ | 222 | */ |
223 | ACPI_ERROR((AE_INFO, | 223 | ACPI_ERROR((AE_INFO, |
224 | "Unsupported object type, cannot convert to external object: %s", | 224 | "Unsupported object type, cannot convert to external object: %s", |
225 | acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE | 225 | acpi_ut_get_type_name(internal_object->common. |
226 | (internal_object)))); | 226 | type))); |
227 | 227 | ||
228 | return_ACPI_STATUS(AE_SUPPORT); | 228 | return_ACPI_STATUS(AE_SUPPORT); |
229 | } | 229 | } |
@@ -355,7 +355,7 @@ acpi_ut_copy_ipackage_to_epackage(union acpi_operand_object *internal_object, | |||
355 | info.object_space = 0; | 355 | info.object_space = 0; |
356 | info.num_packages = 1; | 356 | info.num_packages = 1; |
357 | 357 | ||
358 | external_object->type = ACPI_GET_OBJECT_TYPE(internal_object); | 358 | external_object->type = internal_object->common.type; |
359 | external_object->package.count = internal_object->package.count; | 359 | external_object->package.count = internal_object->package.count; |
360 | external_object->package.elements = ACPI_CAST_PTR(union acpi_object, | 360 | external_object->package.elements = ACPI_CAST_PTR(union acpi_object, |
361 | info.free_space); | 361 | info.free_space); |
@@ -399,7 +399,7 @@ acpi_ut_copy_iobject_to_eobject(union acpi_operand_object *internal_object, | |||
399 | 399 | ||
400 | ACPI_FUNCTION_TRACE(ut_copy_iobject_to_eobject); | 400 | ACPI_FUNCTION_TRACE(ut_copy_iobject_to_eobject); |
401 | 401 | ||
402 | if (ACPI_GET_OBJECT_TYPE(internal_object) == ACPI_TYPE_PACKAGE) { | 402 | if (internal_object->common.type == ACPI_TYPE_PACKAGE) { |
403 | /* | 403 | /* |
404 | * Package object: Copy all subobjects (including | 404 | * Package object: Copy all subobjects (including |
405 | * nested packages) | 405 | * nested packages) |
@@ -496,8 +496,9 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object, | |||
496 | case ACPI_TYPE_STRING: | 496 | case ACPI_TYPE_STRING: |
497 | 497 | ||
498 | internal_object->string.pointer = | 498 | internal_object->string.pointer = |
499 | ACPI_ALLOCATE_ZEROED((acpi_size) external_object->string. | 499 | ACPI_ALLOCATE_ZEROED((acpi_size) |
500 | length + 1); | 500 | external_object->string.length + 1); |
501 | |||
501 | if (!internal_object->string.pointer) { | 502 | if (!internal_object->string.pointer) { |
502 | goto error_exit; | 503 | goto error_exit; |
503 | } | 504 | } |
@@ -697,7 +698,7 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, | |||
697 | 698 | ||
698 | /* Handle the objects with extra data */ | 699 | /* Handle the objects with extra data */ |
699 | 700 | ||
700 | switch (ACPI_GET_OBJECT_TYPE(dest_desc)) { | 701 | switch (dest_desc->common.type) { |
701 | case ACPI_TYPE_BUFFER: | 702 | case ACPI_TYPE_BUFFER: |
702 | /* | 703 | /* |
703 | * Allocate and copy the actual buffer if and only if: | 704 | * Allocate and copy the actual buffer if and only if: |
@@ -814,8 +815,8 @@ acpi_ut_copy_ielement_to_ielement(u8 object_type, | |||
814 | * This is a simple object, just copy it | 815 | * This is a simple object, just copy it |
815 | */ | 816 | */ |
816 | target_object = | 817 | target_object = |
817 | acpi_ut_create_internal_object(ACPI_GET_OBJECT_TYPE | 818 | acpi_ut_create_internal_object(source_object-> |
818 | (source_object)); | 819 | common.type); |
819 | if (!target_object) { | 820 | if (!target_object) { |
820 | return (AE_NO_MEMORY); | 821 | return (AE_NO_MEMORY); |
821 | } | 822 | } |
@@ -892,7 +893,7 @@ acpi_ut_copy_ipackage_to_ipackage(union acpi_operand_object *source_obj, | |||
892 | 893 | ||
893 | ACPI_FUNCTION_TRACE(ut_copy_ipackage_to_ipackage); | 894 | ACPI_FUNCTION_TRACE(ut_copy_ipackage_to_ipackage); |
894 | 895 | ||
895 | dest_obj->common.type = ACPI_GET_OBJECT_TYPE(source_obj); | 896 | dest_obj->common.type = source_obj->common.type; |
896 | dest_obj->common.flags = source_obj->common.flags; | 897 | dest_obj->common.flags = source_obj->common.flags; |
897 | dest_obj->package.count = source_obj->package.count; | 898 | dest_obj->package.count = source_obj->package.count; |
898 | 899 | ||
@@ -950,15 +951,14 @@ acpi_ut_copy_iobject_to_iobject(union acpi_operand_object *source_desc, | |||
950 | 951 | ||
951 | /* Create the top level object */ | 952 | /* Create the top level object */ |
952 | 953 | ||
953 | *dest_desc = | 954 | *dest_desc = acpi_ut_create_internal_object(source_desc->common.type); |
954 | acpi_ut_create_internal_object(ACPI_GET_OBJECT_TYPE(source_desc)); | ||
955 | if (!*dest_desc) { | 955 | if (!*dest_desc) { |
956 | return_ACPI_STATUS(AE_NO_MEMORY); | 956 | return_ACPI_STATUS(AE_NO_MEMORY); |
957 | } | 957 | } |
958 | 958 | ||
959 | /* Copy the object and possible subobjects */ | 959 | /* Copy the object and possible subobjects */ |
960 | 960 | ||
961 | if (ACPI_GET_OBJECT_TYPE(source_desc) == ACPI_TYPE_PACKAGE) { | 961 | if (source_desc->common.type == ACPI_TYPE_PACKAGE) { |
962 | status = | 962 | status = |
963 | acpi_ut_copy_ipackage_to_ipackage(source_desc, *dest_desc, | 963 | acpi_ut_copy_ipackage_to_ipackage(source_desc, *dest_desc, |
964 | walk_state); | 964 | walk_state); |