diff options
Diffstat (limited to 'drivers/acpi')
38 files changed, 158 insertions, 194 deletions
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h index 9c127e8e2d6d..91ac7d7b4402 100644 --- a/drivers/acpi/acpica/acmacros.h +++ b/drivers/acpi/acpica/acmacros.h | |||
@@ -292,10 +292,6 @@ | |||
292 | #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type) | 292 | #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type) |
293 | #define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t) | 293 | #define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t) |
294 | 294 | ||
295 | /* Macro to test the object type */ | ||
296 | |||
297 | #define ACPI_GET_OBJECT_TYPE(d) (((union acpi_operand_object *)(void *)(d))->common.type) | ||
298 | |||
299 | /* | 295 | /* |
300 | * Macros for the master AML opcode table | 296 | * Macros for the master AML opcode table |
301 | */ | 297 | */ |
diff --git a/drivers/acpi/acpica/dsmthdat.c b/drivers/acpi/acpica/dsmthdat.c index da0f5468184c..22b1a3ce2c94 100644 --- a/drivers/acpi/acpica/dsmthdat.c +++ b/drivers/acpi/acpica/dsmthdat.c | |||
@@ -713,6 +713,6 @@ acpi_ds_method_data_get_type(u16 opcode, | |||
713 | 713 | ||
714 | /* Get the object type */ | 714 | /* Get the object type */ |
715 | 715 | ||
716 | return_VALUE(ACPI_GET_OBJECT_TYPE(object)); | 716 | return_VALUE(object->type); |
717 | } | 717 | } |
718 | #endif | 718 | #endif |
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c index 15c628e6aa00..dab3f48f0b42 100644 --- a/drivers/acpi/acpica/dsobject.c +++ b/drivers/acpi/acpica/dsobject.c | |||
@@ -565,7 +565,7 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state, | |||
565 | 565 | ||
566 | /* Re-type the object according to its argument */ | 566 | /* Re-type the object according to its argument */ |
567 | 567 | ||
568 | node->type = ACPI_GET_OBJECT_TYPE(obj_desc); | 568 | node->type = obj_desc->common.type; |
569 | 569 | ||
570 | /* Attach obj to node */ | 570 | /* Attach obj to node */ |
571 | 571 | ||
@@ -619,7 +619,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, | |||
619 | 619 | ||
620 | /* Perform per-object initialization */ | 620 | /* Perform per-object initialization */ |
621 | 621 | ||
622 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 622 | switch (obj_desc->common.type) { |
623 | case ACPI_TYPE_BUFFER: | 623 | case ACPI_TYPE_BUFFER: |
624 | 624 | ||
625 | /* | 625 | /* |
@@ -803,7 +803,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, | |||
803 | default: | 803 | default: |
804 | 804 | ||
805 | ACPI_ERROR((AE_INFO, "Unimplemented data type: %X", | 805 | ACPI_ERROR((AE_INFO, "Unimplemented data type: %X", |
806 | ACPI_GET_OBJECT_TYPE(obj_desc))); | 806 | obj_desc->common.type)); |
807 | 807 | ||
808 | status = AE_AML_OPERAND_TYPE; | 808 | status = AE_AML_OPERAND_TYPE; |
809 | break; | 809 | break; |
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c index 0c3b4dd60e8a..602ddaa10c29 100644 --- a/drivers/acpi/acpica/dsopcode.c +++ b/drivers/acpi/acpica/dsopcode.c | |||
@@ -484,7 +484,7 @@ acpi_ds_init_buffer_field(u16 aml_opcode, | |||
484 | 484 | ||
485 | /* Host object must be a Buffer */ | 485 | /* Host object must be a Buffer */ |
486 | 486 | ||
487 | if (ACPI_GET_OBJECT_TYPE(buffer_desc) != ACPI_TYPE_BUFFER) { | 487 | if (buffer_desc->common.type != ACPI_TYPE_BUFFER) { |
488 | ACPI_ERROR((AE_INFO, | 488 | ACPI_ERROR((AE_INFO, |
489 | "Target of Create Field is not a Buffer object - %s", | 489 | "Target of Create Field is not a Buffer object - %s", |
490 | acpi_ut_get_object_type_name(buffer_desc))); | 490 | acpi_ut_get_object_type_name(buffer_desc))); |
@@ -1365,10 +1365,8 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state, | |||
1365 | if ((ACPI_GET_DESCRIPTOR_TYPE | 1365 | if ((ACPI_GET_DESCRIPTOR_TYPE |
1366 | (walk_state->results->results.obj_desc[0]) == | 1366 | (walk_state->results->results.obj_desc[0]) == |
1367 | ACPI_DESC_TYPE_OPERAND) | 1367 | ACPI_DESC_TYPE_OPERAND) |
1368 | && | 1368 | && ((walk_state->results->results.obj_desc[0])-> |
1369 | (ACPI_GET_OBJECT_TYPE | 1369 | common.type == ACPI_TYPE_LOCAL_REFERENCE) |
1370 | (walk_state->results->results.obj_desc[0]) == | ||
1371 | ACPI_TYPE_LOCAL_REFERENCE) | ||
1372 | && ((walk_state->results->results.obj_desc[0])-> | 1370 | && ((walk_state->results->results.obj_desc[0])-> |
1373 | reference.class != ACPI_REFCLASS_INDEX)) { | 1371 | reference.class != ACPI_REFCLASS_INDEX)) { |
1374 | status = | 1372 | status = |
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c index dabc23a46176..dfa104102926 100644 --- a/drivers/acpi/acpica/dsutils.c +++ b/drivers/acpi/acpica/dsutils.c | |||
@@ -816,7 +816,7 @@ acpi_status acpi_ds_evaluate_name_path(struct acpi_walk_state *walk_state) | |||
816 | goto push_result; | 816 | goto push_result; |
817 | } | 817 | } |
818 | 818 | ||
819 | type = ACPI_GET_OBJECT_TYPE(*operand); | 819 | type = (*operand)->common.type; |
820 | 820 | ||
821 | status = acpi_ex_resolve_to_value(operand, walk_state); | 821 | status = acpi_ex_resolve_to_value(operand, walk_state); |
822 | if (ACPI_FAILURE(status)) { | 822 | if (ACPI_FAILURE(status)) { |
diff --git a/drivers/acpi/acpica/dswexec.c b/drivers/acpi/acpica/dswexec.c index 350e6656bc89..f0280856dc0e 100644 --- a/drivers/acpi/acpica/dswexec.c +++ b/drivers/acpi/acpica/dswexec.c | |||
@@ -138,11 +138,10 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state, | |||
138 | goto cleanup; | 138 | goto cleanup; |
139 | } | 139 | } |
140 | 140 | ||
141 | if (ACPI_GET_OBJECT_TYPE(local_obj_desc) != ACPI_TYPE_INTEGER) { | 141 | if (local_obj_desc->common.type != ACPI_TYPE_INTEGER) { |
142 | ACPI_ERROR((AE_INFO, | 142 | ACPI_ERROR((AE_INFO, |
143 | "Bad predicate (not an integer) ObjDesc=%p State=%p Type=%X", | 143 | "Bad predicate (not an integer) ObjDesc=%p State=%p Type=%X", |
144 | obj_desc, walk_state, | 144 | obj_desc, walk_state, obj_desc->common.type)); |
145 | ACPI_GET_OBJECT_TYPE(obj_desc))); | ||
146 | 145 | ||
147 | status = AE_AML_OPERAND_TYPE; | 146 | status = AE_AML_OPERAND_TYPE; |
148 | goto cleanup; | 147 | goto cleanup; |
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c index 484cc0565d5b..f7b3d2af9401 100644 --- a/drivers/acpi/acpica/evgpeblk.c +++ b/drivers/acpi/acpica/evgpeblk.c | |||
@@ -408,7 +408,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle, | |||
408 | */ | 408 | */ |
409 | obj_desc = pkg_desc->package.elements[0]; | 409 | obj_desc = pkg_desc->package.elements[0]; |
410 | 410 | ||
411 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { | 411 | if (obj_desc->common.type == ACPI_TYPE_INTEGER) { |
412 | 412 | ||
413 | /* Use FADT-defined GPE device (from definition of _PRW) */ | 413 | /* Use FADT-defined GPE device (from definition of _PRW) */ |
414 | 414 | ||
@@ -417,14 +417,14 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle, | |||
417 | /* Integer is the GPE number in the FADT described GPE blocks */ | 417 | /* Integer is the GPE number in the FADT described GPE blocks */ |
418 | 418 | ||
419 | gpe_number = (u32) obj_desc->integer.value; | 419 | gpe_number = (u32) obj_desc->integer.value; |
420 | } else if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_PACKAGE) { | 420 | } else if (obj_desc->common.type == ACPI_TYPE_PACKAGE) { |
421 | 421 | ||
422 | /* Package contains a GPE reference and GPE number within a GPE block */ | 422 | /* Package contains a GPE reference and GPE number within a GPE block */ |
423 | 423 | ||
424 | if ((obj_desc->package.count < 2) || | 424 | if ((obj_desc->package.count < 2) || |
425 | (ACPI_GET_OBJECT_TYPE(obj_desc->package.elements[0]) != | 425 | ((obj_desc->package.elements[0])->common.type != |
426 | ACPI_TYPE_LOCAL_REFERENCE) | 426 | ACPI_TYPE_LOCAL_REFERENCE) |
427 | || (ACPI_GET_OBJECT_TYPE(obj_desc->package.elements[1]) != | 427 | || ((obj_desc->package.elements[1])->common.type != |
428 | ACPI_TYPE_INTEGER)) { | 428 | ACPI_TYPE_INTEGER)) { |
429 | goto cleanup; | 429 | goto cleanup; |
430 | } | 430 | } |
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c index 665c0887ab4d..86cbbdbfc5cd 100644 --- a/drivers/acpi/acpica/evregion.c +++ b/drivers/acpi/acpica/evregion.c | |||
@@ -691,7 +691,7 @@ acpi_ev_install_handler(acpi_handle obj_handle, | |||
691 | 691 | ||
692 | /* Devices are handled different than regions */ | 692 | /* Devices are handled different than regions */ |
693 | 693 | ||
694 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_DEVICE) { | 694 | if (obj_desc->common.type == ACPI_TYPE_DEVICE) { |
695 | 695 | ||
696 | /* Check if this Device already has a handler for this address space */ | 696 | /* Check if this Device already has a handler for this address space */ |
697 | 697 | ||
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c index 932bbc26aa04..70b39c7daeab 100644 --- a/drivers/acpi/acpica/exconfig.c +++ b/drivers/acpi/acpica/exconfig.c | |||
@@ -291,7 +291,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, | |||
291 | 291 | ||
292 | /* Source Object can be either an op_region or a Buffer/Field */ | 292 | /* Source Object can be either an op_region or a Buffer/Field */ |
293 | 293 | ||
294 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 294 | switch (obj_desc->common.type) { |
295 | case ACPI_TYPE_REGION: | 295 | case ACPI_TYPE_REGION: |
296 | 296 | ||
297 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | 297 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
@@ -501,7 +501,7 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle) | |||
501 | */ | 501 | */ |
502 | if ((!ddb_handle) || | 502 | if ((!ddb_handle) || |
503 | (ACPI_GET_DESCRIPTOR_TYPE(ddb_handle) != ACPI_DESC_TYPE_OPERAND) || | 503 | (ACPI_GET_DESCRIPTOR_TYPE(ddb_handle) != ACPI_DESC_TYPE_OPERAND) || |
504 | (ACPI_GET_OBJECT_TYPE(ddb_handle) != ACPI_TYPE_LOCAL_REFERENCE)) { | 504 | (ddb_handle->common.type != ACPI_TYPE_LOCAL_REFERENCE)) { |
505 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 505 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
506 | } | 506 | } |
507 | 507 | ||
diff --git a/drivers/acpi/acpica/exconvrt.c b/drivers/acpi/acpica/exconvrt.c index 0be10188316e..37d0d39e60a6 100644 --- a/drivers/acpi/acpica/exconvrt.c +++ b/drivers/acpi/acpica/exconvrt.c | |||
@@ -82,7 +82,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc, | |||
82 | 82 | ||
83 | ACPI_FUNCTION_TRACE_PTR(ex_convert_to_integer, obj_desc); | 83 | ACPI_FUNCTION_TRACE_PTR(ex_convert_to_integer, obj_desc); |
84 | 84 | ||
85 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 85 | switch (obj_desc->common.type) { |
86 | case ACPI_TYPE_INTEGER: | 86 | case ACPI_TYPE_INTEGER: |
87 | 87 | ||
88 | /* No conversion necessary */ | 88 | /* No conversion necessary */ |
@@ -116,7 +116,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc, | |||
116 | 116 | ||
117 | /* String conversion is different than Buffer conversion */ | 117 | /* String conversion is different than Buffer conversion */ |
118 | 118 | ||
119 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 119 | switch (obj_desc->common.type) { |
120 | case ACPI_TYPE_STRING: | 120 | case ACPI_TYPE_STRING: |
121 | 121 | ||
122 | /* | 122 | /* |
@@ -206,7 +206,7 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc, | |||
206 | 206 | ||
207 | ACPI_FUNCTION_TRACE_PTR(ex_convert_to_buffer, obj_desc); | 207 | ACPI_FUNCTION_TRACE_PTR(ex_convert_to_buffer, obj_desc); |
208 | 208 | ||
209 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 209 | switch (obj_desc->common.type) { |
210 | case ACPI_TYPE_BUFFER: | 210 | case ACPI_TYPE_BUFFER: |
211 | 211 | ||
212 | /* No conversion necessary */ | 212 | /* No conversion necessary */ |
@@ -409,7 +409,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, | |||
409 | 409 | ||
410 | ACPI_FUNCTION_TRACE_PTR(ex_convert_to_string, obj_desc); | 410 | ACPI_FUNCTION_TRACE_PTR(ex_convert_to_string, obj_desc); |
411 | 411 | ||
412 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 412 | switch (obj_desc->common.type) { |
413 | case ACPI_TYPE_STRING: | 413 | case ACPI_TYPE_STRING: |
414 | 414 | ||
415 | /* No conversion necessary */ | 415 | /* No conversion necessary */ |
@@ -605,8 +605,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type, | |||
605 | default: | 605 | default: |
606 | /* No conversion allowed for these types */ | 606 | /* No conversion allowed for these types */ |
607 | 607 | ||
608 | if (destination_type != | 608 | if (destination_type != source_desc->common.type) { |
609 | ACPI_GET_OBJECT_TYPE(source_desc)) { | ||
610 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 609 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
611 | "Explicit operator, will store (%s) over existing type (%s)\n", | 610 | "Explicit operator, will store (%s) over existing type (%s)\n", |
612 | acpi_ut_get_object_type_name | 611 | acpi_ut_get_object_type_name |
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c index aa313574b0df..193d23312e18 100644 --- a/drivers/acpi/acpica/exdump.c +++ b/drivers/acpi/acpica/exdump.c | |||
@@ -492,7 +492,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) | |||
492 | 492 | ||
493 | /* Decode object type */ | 493 | /* Decode object type */ |
494 | 494 | ||
495 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 495 | switch (obj_desc->common.type) { |
496 | case ACPI_TYPE_LOCAL_REFERENCE: | 496 | case ACPI_TYPE_LOCAL_REFERENCE: |
497 | 497 | ||
498 | acpi_os_printf("Reference: [%s] ", | 498 | acpi_os_printf("Reference: [%s] ", |
@@ -531,7 +531,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) | |||
531 | 531 | ||
532 | acpi_os_printf("%X", obj_desc->reference.value); | 532 | acpi_os_printf("%X", obj_desc->reference.value); |
533 | 533 | ||
534 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { | 534 | if (obj_desc->common.type == ACPI_TYPE_INTEGER) { |
535 | 535 | ||
536 | /* Value is an Integer */ | 536 | /* Value is an Integer */ |
537 | 537 | ||
@@ -548,7 +548,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) | |||
548 | 548 | ||
549 | acpi_os_printf("%X", obj_desc->reference.value); | 549 | acpi_os_printf("%X", obj_desc->reference.value); |
550 | 550 | ||
551 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { | 551 | if (obj_desc->common.type == ACPI_TYPE_INTEGER) { |
552 | 552 | ||
553 | /* Value is an Integer */ | 553 | /* Value is an Integer */ |
554 | 554 | ||
@@ -686,9 +686,8 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) | |||
686 | 686 | ||
687 | if (!obj_desc->buffer_field.buffer_obj) { | 687 | if (!obj_desc->buffer_field.buffer_obj) { |
688 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "*NULL*\n")); | 688 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "*NULL*\n")); |
689 | } else | 689 | } else if ((obj_desc->buffer_field.buffer_obj)->common.type != |
690 | if (ACPI_GET_OBJECT_TYPE(obj_desc->buffer_field.buffer_obj) | 690 | ACPI_TYPE_BUFFER) { |
691 | != ACPI_TYPE_BUFFER) { | ||
692 | acpi_os_printf("*not a Buffer*\n"); | 691 | acpi_os_printf("*not a Buffer*\n"); |
693 | } else { | 692 | } else { |
694 | acpi_ex_dump_operand(obj_desc->buffer_field.buffer_obj, | 693 | acpi_ex_dump_operand(obj_desc->buffer_field.buffer_obj, |
@@ -737,8 +736,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) | |||
737 | default: | 736 | default: |
738 | /* Unknown Type */ | 737 | /* Unknown Type */ |
739 | 738 | ||
740 | acpi_os_printf("Unknown Type %X\n", | 739 | acpi_os_printf("Unknown Type %X\n", obj_desc->common.type); |
741 | ACPI_GET_OBJECT_TYPE(obj_desc)); | ||
742 | break; | 740 | break; |
743 | } | 741 | } |
744 | 742 | ||
@@ -939,7 +937,7 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc, | |||
939 | 937 | ||
940 | /* Packages may only contain a few object types */ | 938 | /* Packages may only contain a few object types */ |
941 | 939 | ||
942 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 940 | switch (obj_desc->common.type) { |
943 | case ACPI_TYPE_INTEGER: | 941 | case ACPI_TYPE_INTEGER: |
944 | 942 | ||
945 | acpi_os_printf("[Integer] = %8.8X%8.8X\n", | 943 | acpi_os_printf("[Integer] = %8.8X%8.8X\n", |
@@ -990,8 +988,7 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc, | |||
990 | 988 | ||
991 | default: | 989 | default: |
992 | 990 | ||
993 | acpi_os_printf("[Unknown Type] %X\n", | 991 | acpi_os_printf("[Unknown Type] %X\n", obj_desc->common.type); |
994 | ACPI_GET_OBJECT_TYPE(obj_desc)); | ||
995 | break; | 992 | break; |
996 | } | 993 | } |
997 | } | 994 | } |
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c index a352d0233857..546dcdd86785 100644 --- a/drivers/acpi/acpica/exfield.c +++ b/drivers/acpi/acpica/exfield.c | |||
@@ -84,7 +84,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, | |||
84 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 84 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
85 | } | 85 | } |
86 | 86 | ||
87 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_BUFFER_FIELD) { | 87 | if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) { |
88 | /* | 88 | /* |
89 | * If the buffer_field arguments have not been previously evaluated, | 89 | * If the buffer_field arguments have not been previously evaluated, |
90 | * evaluate them now and save the results. | 90 | * evaluate them now and save the results. |
@@ -95,9 +95,8 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, | |||
95 | return_ACPI_STATUS(status); | 95 | return_ACPI_STATUS(status); |
96 | } | 96 | } |
97 | } | 97 | } |
98 | } else | 98 | } else if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) && |
99 | if ((ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REGION_FIELD) | 99 | (obj_desc->field.region_obj->region.space_id == |
100 | && (obj_desc->field.region_obj->region.space_id == | ||
101 | ACPI_ADR_SPACE_SMBUS)) { | 100 | ACPI_ADR_SPACE_SMBUS)) { |
102 | /* | 101 | /* |
103 | * This is an SMBus read. We must create a buffer to hold the data | 102 | * This is an SMBus read. We must create a buffer to hold the data |
@@ -163,7 +162,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, | |||
163 | 162 | ||
164 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, | 163 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, |
165 | "FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n", | 164 | "FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n", |
166 | obj_desc, ACPI_GET_OBJECT_TYPE(obj_desc), buffer, | 165 | obj_desc, obj_desc->common.type, buffer, |
167 | (u32) length)); | 166 | (u32) length)); |
168 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, | 167 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, |
169 | "FieldRead [FROM]: BitLen %X, BitOff %X, ByteOff %X\n", | 168 | "FieldRead [FROM]: BitLen %X, BitOff %X, ByteOff %X\n", |
@@ -222,7 +221,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
222 | return_ACPI_STATUS(AE_AML_NO_OPERAND); | 221 | return_ACPI_STATUS(AE_AML_NO_OPERAND); |
223 | } | 222 | } |
224 | 223 | ||
225 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_BUFFER_FIELD) { | 224 | if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) { |
226 | /* | 225 | /* |
227 | * If the buffer_field arguments have not been previously evaluated, | 226 | * If the buffer_field arguments have not been previously evaluated, |
228 | * evaluate them now and save the results. | 227 | * evaluate them now and save the results. |
@@ -233,9 +232,8 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
233 | return_ACPI_STATUS(status); | 232 | return_ACPI_STATUS(status); |
234 | } | 233 | } |
235 | } | 234 | } |
236 | } else | 235 | } else if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) && |
237 | if ((ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REGION_FIELD) | 236 | (obj_desc->field.region_obj->region.space_id == |
238 | && (obj_desc->field.region_obj->region.space_id == | ||
239 | ACPI_ADR_SPACE_SMBUS)) { | 237 | ACPI_ADR_SPACE_SMBUS)) { |
240 | /* | 238 | /* |
241 | * This is an SMBus write. We will bypass the entire field mechanism | 239 | * This is an SMBus write. We will bypass the entire field mechanism |
@@ -243,7 +241,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
243 | * | 241 | * |
244 | * Source must be a buffer of sufficient size (ACPI_SMBUS_BUFFER_SIZE). | 242 | * Source must be a buffer of sufficient size (ACPI_SMBUS_BUFFER_SIZE). |
245 | */ | 243 | */ |
246 | if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_BUFFER) { | 244 | if (source_desc->common.type != ACPI_TYPE_BUFFER) { |
247 | ACPI_ERROR((AE_INFO, | 245 | ACPI_ERROR((AE_INFO, |
248 | "SMBus write requires Buffer, found type %s", | 246 | "SMBus write requires Buffer, found type %s", |
249 | acpi_ut_get_object_type_name(source_desc))); | 247 | acpi_ut_get_object_type_name(source_desc))); |
@@ -291,7 +289,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
291 | 289 | ||
292 | /* Get a pointer to the data to be written */ | 290 | /* Get a pointer to the data to be written */ |
293 | 291 | ||
294 | switch (ACPI_GET_OBJECT_TYPE(source_desc)) { | 292 | switch (source_desc->common.type) { |
295 | case ACPI_TYPE_INTEGER: | 293 | case ACPI_TYPE_INTEGER: |
296 | buffer = &source_desc->integer.value; | 294 | buffer = &source_desc->integer.value; |
297 | length = sizeof(source_desc->integer.value); | 295 | length = sizeof(source_desc->integer.value); |
@@ -314,15 +312,14 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, | |||
314 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, | 312 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, |
315 | "FieldWrite [FROM]: Obj %p (%s:%X), Buf %p, ByteLen %X\n", | 313 | "FieldWrite [FROM]: Obj %p (%s:%X), Buf %p, ByteLen %X\n", |
316 | source_desc, | 314 | source_desc, |
317 | acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE | 315 | acpi_ut_get_type_name(source_desc->common.type), |
318 | (source_desc)), | 316 | source_desc->common.type, buffer, length)); |
319 | ACPI_GET_OBJECT_TYPE(source_desc), buffer, length)); | ||
320 | 317 | ||
321 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, | 318 | ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, |
322 | "FieldWrite [TO]: Obj %p (%s:%X), BitLen %X, BitOff %X, ByteOff %X\n", | 319 | "FieldWrite [TO]: Obj %p (%s:%X), BitLen %X, BitOff %X, ByteOff %X\n", |
323 | obj_desc, | 320 | obj_desc, |
324 | acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE(obj_desc)), | 321 | acpi_ut_get_type_name(obj_desc->common.type), |
325 | ACPI_GET_OBJECT_TYPE(obj_desc), | 322 | obj_desc->common.type, |
326 | obj_desc->common_field.bit_length, | 323 | obj_desc->common_field.bit_length, |
327 | obj_desc->common_field.start_field_bit_offset, | 324 | obj_desc->common_field.start_field_bit_offset, |
328 | obj_desc->common_field.base_byte_offset)); | 325 | obj_desc->common_field.base_byte_offset)); |
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c index ef58ac4e687b..1053e7cd92a1 100644 --- a/drivers/acpi/acpica/exfldio.c +++ b/drivers/acpi/acpica/exfldio.c | |||
@@ -94,9 +94,9 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, | |||
94 | 94 | ||
95 | /* We must have a valid region */ | 95 | /* We must have a valid region */ |
96 | 96 | ||
97 | if (ACPI_GET_OBJECT_TYPE(rgn_desc) != ACPI_TYPE_REGION) { | 97 | if (rgn_desc->common.type != ACPI_TYPE_REGION) { |
98 | ACPI_ERROR((AE_INFO, "Needed Region, found type %X (%s)", | 98 | ACPI_ERROR((AE_INFO, "Needed Region, found type %X (%s)", |
99 | ACPI_GET_OBJECT_TYPE(rgn_desc), | 99 | rgn_desc->common.type, |
100 | acpi_ut_get_object_type_name(rgn_desc))); | 100 | acpi_ut_get_object_type_name(rgn_desc))); |
101 | 101 | ||
102 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 102 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
@@ -390,7 +390,7 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, | |||
390 | * index_field - Write to an Index Register, then read/write from/to a | 390 | * index_field - Write to an Index Register, then read/write from/to a |
391 | * Data Register | 391 | * Data Register |
392 | */ | 392 | */ |
393 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 393 | switch (obj_desc->common.type) { |
394 | case ACPI_TYPE_BUFFER_FIELD: | 394 | case ACPI_TYPE_BUFFER_FIELD: |
395 | /* | 395 | /* |
396 | * If the buffer_field arguments have not been previously evaluated, | 396 | * If the buffer_field arguments have not been previously evaluated, |
@@ -527,7 +527,7 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, | |||
527 | default: | 527 | default: |
528 | 528 | ||
529 | ACPI_ERROR((AE_INFO, "Wrong object type in field I/O %X", | 529 | ACPI_ERROR((AE_INFO, "Wrong object type in field I/O %X", |
530 | ACPI_GET_OBJECT_TYPE(obj_desc))); | 530 | obj_desc->common.type)); |
531 | status = AE_AML_INTERNAL; | 531 | status = AE_AML_INTERNAL; |
532 | break; | 532 | break; |
533 | } | 533 | } |
diff --git a/drivers/acpi/acpica/exmisc.c b/drivers/acpi/acpica/exmisc.c index 6b0747ac683b..998eac329937 100644 --- a/drivers/acpi/acpica/exmisc.c +++ b/drivers/acpi/acpica/exmisc.c | |||
@@ -80,7 +80,7 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc, | |||
80 | switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) { | 80 | switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) { |
81 | case ACPI_DESC_TYPE_OPERAND: | 81 | case ACPI_DESC_TYPE_OPERAND: |
82 | 82 | ||
83 | if (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_LOCAL_REFERENCE) { | 83 | if (obj_desc->common.type != ACPI_TYPE_LOCAL_REFERENCE) { |
84 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 84 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
85 | } | 85 | } |
86 | 86 | ||
@@ -260,7 +260,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, | |||
260 | * guaranteed to be either Integer/String/Buffer by the operand | 260 | * guaranteed to be either Integer/String/Buffer by the operand |
261 | * resolution mechanism. | 261 | * resolution mechanism. |
262 | */ | 262 | */ |
263 | switch (ACPI_GET_OBJECT_TYPE(operand0)) { | 263 | switch (operand0->common.type) { |
264 | case ACPI_TYPE_INTEGER: | 264 | case ACPI_TYPE_INTEGER: |
265 | status = | 265 | status = |
266 | acpi_ex_convert_to_integer(operand1, &local_operand1, 16); | 266 | acpi_ex_convert_to_integer(operand1, &local_operand1, 16); |
@@ -277,7 +277,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, | |||
277 | 277 | ||
278 | default: | 278 | default: |
279 | ACPI_ERROR((AE_INFO, "Invalid object type: %X", | 279 | ACPI_ERROR((AE_INFO, "Invalid object type: %X", |
280 | ACPI_GET_OBJECT_TYPE(operand0))); | 280 | operand0->common.type)); |
281 | status = AE_AML_INTERNAL; | 281 | status = AE_AML_INTERNAL; |
282 | } | 282 | } |
283 | 283 | ||
@@ -298,7 +298,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, | |||
298 | * 2) Two Strings concatenated to produce a new String | 298 | * 2) Two Strings concatenated to produce a new String |
299 | * 3) Two Buffers concatenated to produce a new Buffer | 299 | * 3) Two Buffers concatenated to produce a new Buffer |
300 | */ | 300 | */ |
301 | switch (ACPI_GET_OBJECT_TYPE(operand0)) { | 301 | switch (operand0->common.type) { |
302 | case ACPI_TYPE_INTEGER: | 302 | case ACPI_TYPE_INTEGER: |
303 | 303 | ||
304 | /* Result of two Integers is a Buffer */ | 304 | /* Result of two Integers is a Buffer */ |
@@ -379,7 +379,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, | |||
379 | /* Invalid object type, should not happen here */ | 379 | /* Invalid object type, should not happen here */ |
380 | 380 | ||
381 | ACPI_ERROR((AE_INFO, "Invalid object type: %X", | 381 | ACPI_ERROR((AE_INFO, "Invalid object type: %X", |
382 | ACPI_GET_OBJECT_TYPE(operand0))); | 382 | operand0->common.type)); |
383 | status = AE_AML_INTERNAL; | 383 | status = AE_AML_INTERNAL; |
384 | goto cleanup; | 384 | goto cleanup; |
385 | } | 385 | } |
@@ -581,7 +581,7 @@ acpi_ex_do_logical_op(u16 opcode, | |||
581 | * guaranteed to be either Integer/String/Buffer by the operand | 581 | * guaranteed to be either Integer/String/Buffer by the operand |
582 | * resolution mechanism. | 582 | * resolution mechanism. |
583 | */ | 583 | */ |
584 | switch (ACPI_GET_OBJECT_TYPE(operand0)) { | 584 | switch (operand0->common.type) { |
585 | case ACPI_TYPE_INTEGER: | 585 | case ACPI_TYPE_INTEGER: |
586 | status = | 586 | status = |
587 | acpi_ex_convert_to_integer(operand1, &local_operand1, 16); | 587 | acpi_ex_convert_to_integer(operand1, &local_operand1, 16); |
@@ -608,7 +608,7 @@ acpi_ex_do_logical_op(u16 opcode, | |||
608 | /* | 608 | /* |
609 | * Two cases: 1) Both Integers, 2) Both Strings or Buffers | 609 | * Two cases: 1) Both Integers, 2) Both Strings or Buffers |
610 | */ | 610 | */ |
611 | if (ACPI_GET_OBJECT_TYPE(operand0) == ACPI_TYPE_INTEGER) { | 611 | if (operand0->common.type == ACPI_TYPE_INTEGER) { |
612 | /* | 612 | /* |
613 | * 1) Both operands are of type integer | 613 | * 1) Both operands are of type integer |
614 | * Note: local_operand1 may have changed above | 614 | * Note: local_operand1 may have changed above |
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c index b530480cc7d5..9635d21e568d 100644 --- a/drivers/acpi/acpica/exoparg1.c +++ b/drivers/acpi/acpica/exoparg1.c | |||
@@ -807,11 +807,9 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) | |||
807 | acpi_namespace_node *) | 807 | acpi_namespace_node *) |
808 | operand[0]); | 808 | operand[0]); |
809 | if (temp_desc | 809 | if (temp_desc |
810 | && | 810 | && ((temp_desc->common.type == ACPI_TYPE_STRING) |
811 | ((ACPI_GET_OBJECT_TYPE(temp_desc) == | 811 | || (temp_desc->common.type == |
812 | ACPI_TYPE_STRING) | 812 | ACPI_TYPE_LOCAL_REFERENCE))) { |
813 | || (ACPI_GET_OBJECT_TYPE(temp_desc) == | ||
814 | ACPI_TYPE_LOCAL_REFERENCE))) { | ||
815 | operand[0] = temp_desc; | 813 | operand[0] = temp_desc; |
816 | acpi_ut_add_reference(temp_desc); | 814 | acpi_ut_add_reference(temp_desc); |
817 | } else { | 815 | } else { |
@@ -819,7 +817,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) | |||
819 | goto cleanup; | 817 | goto cleanup; |
820 | } | 818 | } |
821 | } else { | 819 | } else { |
822 | switch (ACPI_GET_OBJECT_TYPE(operand[0])) { | 820 | switch ((operand[0])->common.type) { |
823 | case ACPI_TYPE_LOCAL_REFERENCE: | 821 | case ACPI_TYPE_LOCAL_REFERENCE: |
824 | /* | 822 | /* |
825 | * This is a deref_of (local_x | arg_x) | 823 | * This is a deref_of (local_x | arg_x) |
@@ -877,8 +875,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) | |||
877 | 875 | ||
878 | if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) != | 876 | if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) != |
879 | ACPI_DESC_TYPE_NAMED) { | 877 | ACPI_DESC_TYPE_NAMED) { |
880 | if (ACPI_GET_OBJECT_TYPE(operand[0]) == | 878 | if ((operand[0])->common.type == ACPI_TYPE_STRING) { |
881 | ACPI_TYPE_STRING) { | ||
882 | /* | 879 | /* |
883 | * This is a deref_of (String). The string is a reference | 880 | * This is a deref_of (String). The string is a reference |
884 | * to a named ACPI object. | 881 | * to a named ACPI object. |
diff --git a/drivers/acpi/acpica/exoparg2.c b/drivers/acpi/acpica/exoparg2.c index 0b4f513ca885..85d95c92dfd3 100644 --- a/drivers/acpi/acpica/exoparg2.c +++ b/drivers/acpi/acpica/exoparg2.c | |||
@@ -399,7 +399,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) | |||
399 | * At this point, the Source operand is a String, Buffer, or Package. | 399 | * At this point, the Source operand is a String, Buffer, or Package. |
400 | * Verify that the index is within range. | 400 | * Verify that the index is within range. |
401 | */ | 401 | */ |
402 | switch (ACPI_GET_OBJECT_TYPE(operand[0])) { | 402 | switch ((operand[0])->common.type) { |
403 | case ACPI_TYPE_STRING: | 403 | case ACPI_TYPE_STRING: |
404 | 404 | ||
405 | if (index >= operand[0]->string.length) { | 405 | if (index >= operand[0]->string.length) { |
diff --git a/drivers/acpi/acpica/exoparg3.c b/drivers/acpi/acpica/exoparg3.c index c6520bbf882b..253f9e122584 100644 --- a/drivers/acpi/acpica/exoparg3.c +++ b/drivers/acpi/acpica/exoparg3.c | |||
@@ -161,9 +161,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) | |||
161 | * Create the return object. The Source operand is guaranteed to be | 161 | * Create the return object. The Source operand is guaranteed to be |
162 | * either a String or a Buffer, so just use its type. | 162 | * either a String or a Buffer, so just use its type. |
163 | */ | 163 | */ |
164 | return_desc = | 164 | return_desc = acpi_ut_create_internal_object((operand[0])-> |
165 | acpi_ut_create_internal_object(ACPI_GET_OBJECT_TYPE | 165 | common.type); |
166 | (operand[0])); | ||
167 | if (!return_desc) { | 166 | if (!return_desc) { |
168 | status = AE_NO_MEMORY; | 167 | status = AE_NO_MEMORY; |
169 | goto cleanup; | 168 | goto cleanup; |
@@ -191,7 +190,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) | |||
191 | 190 | ||
192 | /* Strings always have a sub-pointer, not so for buffers */ | 191 | /* Strings always have a sub-pointer, not so for buffers */ |
193 | 192 | ||
194 | switch (ACPI_GET_OBJECT_TYPE(operand[0])) { | 193 | switch ((operand[0])->common.type) { |
195 | case ACPI_TYPE_STRING: | 194 | case ACPI_TYPE_STRING: |
196 | 195 | ||
197 | /* Always allocate a new buffer for the String */ | 196 | /* Always allocate a new buffer for the String */ |
diff --git a/drivers/acpi/acpica/exprep.c b/drivers/acpi/acpica/exprep.c index a226f74d4a5c..52fec07064f0 100644 --- a/drivers/acpi/acpica/exprep.c +++ b/drivers/acpi/acpica/exprep.c | |||
@@ -279,7 +279,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc, | |||
279 | return_UINT32(0); | 279 | return_UINT32(0); |
280 | } | 280 | } |
281 | 281 | ||
282 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_BUFFER_FIELD) { | 282 | if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) { |
283 | /* | 283 | /* |
284 | * buffer_field access can be on any byte boundary, so the | 284 | * buffer_field access can be on any byte boundary, so the |
285 | * byte_alignment is always 1 byte -- regardless of any byte_alignment | 285 | * byte_alignment is always 1 byte -- regardless of any byte_alignment |
diff --git a/drivers/acpi/acpica/exresnte.c b/drivers/acpi/acpica/exresnte.c index a063a74006f6..607958ff467c 100644 --- a/drivers/acpi/acpica/exresnte.c +++ b/drivers/acpi/acpica/exresnte.c | |||
@@ -136,7 +136,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr, | |||
136 | switch (entry_type) { | 136 | switch (entry_type) { |
137 | case ACPI_TYPE_PACKAGE: | 137 | case ACPI_TYPE_PACKAGE: |
138 | 138 | ||
139 | if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_PACKAGE) { | 139 | if (source_desc->common.type != ACPI_TYPE_PACKAGE) { |
140 | ACPI_ERROR((AE_INFO, "Object not a Package, type %s", | 140 | ACPI_ERROR((AE_INFO, "Object not a Package, type %s", |
141 | acpi_ut_get_object_type_name(source_desc))); | 141 | acpi_ut_get_object_type_name(source_desc))); |
142 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 142 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
@@ -154,7 +154,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr, | |||
154 | 154 | ||
155 | case ACPI_TYPE_BUFFER: | 155 | case ACPI_TYPE_BUFFER: |
156 | 156 | ||
157 | if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_BUFFER) { | 157 | if (source_desc->common.type != ACPI_TYPE_BUFFER) { |
158 | ACPI_ERROR((AE_INFO, "Object not a Buffer, type %s", | 158 | ACPI_ERROR((AE_INFO, "Object not a Buffer, type %s", |
159 | acpi_ut_get_object_type_name(source_desc))); | 159 | acpi_ut_get_object_type_name(source_desc))); |
160 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 160 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
@@ -172,7 +172,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr, | |||
172 | 172 | ||
173 | case ACPI_TYPE_STRING: | 173 | case ACPI_TYPE_STRING: |
174 | 174 | ||
175 | if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_STRING) { | 175 | if (source_desc->common.type != ACPI_TYPE_STRING) { |
176 | ACPI_ERROR((AE_INFO, "Object not a String, type %s", | 176 | ACPI_ERROR((AE_INFO, "Object not a String, type %s", |
177 | acpi_ut_get_object_type_name(source_desc))); | 177 | acpi_ut_get_object_type_name(source_desc))); |
178 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 178 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
@@ -186,7 +186,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr, | |||
186 | 186 | ||
187 | case ACPI_TYPE_INTEGER: | 187 | case ACPI_TYPE_INTEGER: |
188 | 188 | ||
189 | if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_INTEGER) { | 189 | if (source_desc->common.type != ACPI_TYPE_INTEGER) { |
190 | ACPI_ERROR((AE_INFO, "Object not a Integer, type %s", | 190 | ACPI_ERROR((AE_INFO, "Object not a Integer, type %s", |
191 | acpi_ut_get_object_type_name(source_desc))); | 191 | acpi_ut_get_object_type_name(source_desc))); |
192 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 192 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
diff --git a/drivers/acpi/acpica/exresolv.c b/drivers/acpi/acpica/exresolv.c index f6105a6d6126..c93b54ce7f78 100644 --- a/drivers/acpi/acpica/exresolv.c +++ b/drivers/acpi/acpica/exresolv.c | |||
@@ -149,7 +149,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, | |||
149 | 149 | ||
150 | /* This is a union acpi_operand_object */ | 150 | /* This is a union acpi_operand_object */ |
151 | 151 | ||
152 | switch (ACPI_GET_OBJECT_TYPE(stack_desc)) { | 152 | switch (stack_desc->common.type) { |
153 | case ACPI_TYPE_LOCAL_REFERENCE: | 153 | case ACPI_TYPE_LOCAL_REFERENCE: |
154 | 154 | ||
155 | ref_type = stack_desc->reference.class; | 155 | ref_type = stack_desc->reference.class; |
@@ -297,8 +297,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, | |||
297 | 297 | ||
298 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | 298 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
299 | "FieldRead SourceDesc=%p Type=%X\n", | 299 | "FieldRead SourceDesc=%p Type=%X\n", |
300 | stack_desc, | 300 | stack_desc, stack_desc->common.type)); |
301 | ACPI_GET_OBJECT_TYPE(stack_desc))); | ||
302 | 301 | ||
303 | status = | 302 | status = |
304 | acpi_ex_read_data_from_field(walk_state, stack_desc, | 303 | acpi_ex_read_data_from_field(walk_state, stack_desc, |
@@ -386,7 +385,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, | |||
386 | * specification of the object_type and size_of operators). This means | 385 | * specification of the object_type and size_of operators). This means |
387 | * traversing the list of possibly many nested references. | 386 | * traversing the list of possibly many nested references. |
388 | */ | 387 | */ |
389 | while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) { | 388 | while (obj_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE) { |
390 | switch (obj_desc->reference.class) { | 389 | switch (obj_desc->reference.class) { |
391 | case ACPI_REFCLASS_REFOF: | 390 | case ACPI_REFCLASS_REFOF: |
392 | case ACPI_REFCLASS_NAME: | 391 | case ACPI_REFCLASS_NAME: |
@@ -518,7 +517,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, | |||
518 | * Now we are guaranteed to have an object that has not been created | 517 | * Now we are guaranteed to have an object that has not been created |
519 | * via the ref_of or Index operators. | 518 | * via the ref_of or Index operators. |
520 | */ | 519 | */ |
521 | type = ACPI_GET_OBJECT_TYPE(obj_desc); | 520 | type = obj_desc->common.type; |
522 | 521 | ||
523 | exit: | 522 | exit: |
524 | /* Convert internal types to external types */ | 523 | /* Convert internal types to external types */ |
diff --git a/drivers/acpi/acpica/exresop.c b/drivers/acpi/acpica/exresop.c index 3c3802764bfb..5c729a9e9131 100644 --- a/drivers/acpi/acpica/exresop.c +++ b/drivers/acpi/acpica/exresop.c | |||
@@ -212,7 +212,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
212 | 212 | ||
213 | /* ACPI internal object */ | 213 | /* ACPI internal object */ |
214 | 214 | ||
215 | object_type = ACPI_GET_OBJECT_TYPE(obj_desc); | 215 | object_type = obj_desc->common.type; |
216 | 216 | ||
217 | /* Check for bad acpi_object_type */ | 217 | /* Check for bad acpi_object_type */ |
218 | 218 | ||
@@ -287,8 +287,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
287 | 287 | ||
288 | if ((ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == | 288 | if ((ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == |
289 | ACPI_DESC_TYPE_OPERAND) | 289 | ACPI_DESC_TYPE_OPERAND) |
290 | && (ACPI_GET_OBJECT_TYPE(obj_desc) == | 290 | && (obj_desc->common.type == ACPI_TYPE_STRING)) { |
291 | ACPI_TYPE_STRING)) { | ||
292 | /* | 291 | /* |
293 | * String found - the string references a named object and | 292 | * String found - the string references a named object and |
294 | * must be resolved to a node | 293 | * must be resolved to a node |
@@ -336,7 +335,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
336 | * -- All others must be resolved below. | 335 | * -- All others must be resolved below. |
337 | */ | 336 | */ |
338 | if ((opcode == AML_STORE_OP) && | 337 | if ((opcode == AML_STORE_OP) && |
339 | (ACPI_GET_OBJECT_TYPE(*stack_ptr) == | 338 | ((*stack_ptr)->common.type == |
340 | ACPI_TYPE_LOCAL_REFERENCE) | 339 | ACPI_TYPE_LOCAL_REFERENCE) |
341 | && ((*stack_ptr)->reference.class == ACPI_REFCLASS_INDEX)) { | 340 | && ((*stack_ptr)->reference.class == ACPI_REFCLASS_INDEX)) { |
342 | goto next_operand; | 341 | goto next_operand; |
@@ -490,7 +489,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
490 | 489 | ||
491 | /* Need an operand of type INTEGER, STRING or BUFFER */ | 490 | /* Need an operand of type INTEGER, STRING or BUFFER */ |
492 | 491 | ||
493 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 492 | switch (obj_desc->common.type) { |
494 | case ACPI_TYPE_INTEGER: | 493 | case ACPI_TYPE_INTEGER: |
495 | case ACPI_TYPE_STRING: | 494 | case ACPI_TYPE_STRING: |
496 | case ACPI_TYPE_BUFFER: | 495 | case ACPI_TYPE_BUFFER: |
@@ -512,7 +511,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
512 | 511 | ||
513 | /* Need an operand of type STRING or BUFFER */ | 512 | /* Need an operand of type STRING or BUFFER */ |
514 | 513 | ||
515 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 514 | switch (obj_desc->common.type) { |
516 | case ACPI_TYPE_STRING: | 515 | case ACPI_TYPE_STRING: |
517 | case ACPI_TYPE_BUFFER: | 516 | case ACPI_TYPE_BUFFER: |
518 | 517 | ||
@@ -553,7 +552,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
553 | * The only reference allowed here is a direct reference to | 552 | * The only reference allowed here is a direct reference to |
554 | * a namespace node. | 553 | * a namespace node. |
555 | */ | 554 | */ |
556 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 555 | switch (obj_desc->common.type) { |
557 | case ACPI_TYPE_PACKAGE: | 556 | case ACPI_TYPE_PACKAGE: |
558 | case ACPI_TYPE_STRING: | 557 | case ACPI_TYPE_STRING: |
559 | case ACPI_TYPE_BUFFER: | 558 | case ACPI_TYPE_BUFFER: |
@@ -576,7 +575,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
576 | 575 | ||
577 | /* Need a buffer or package or (ACPI 2.0) String */ | 576 | /* Need a buffer or package or (ACPI 2.0) String */ |
578 | 577 | ||
579 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 578 | switch (obj_desc->common.type) { |
580 | case ACPI_TYPE_PACKAGE: | 579 | case ACPI_TYPE_PACKAGE: |
581 | case ACPI_TYPE_STRING: | 580 | case ACPI_TYPE_STRING: |
582 | case ACPI_TYPE_BUFFER: | 581 | case ACPI_TYPE_BUFFER: |
@@ -598,7 +597,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
598 | 597 | ||
599 | /* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */ | 598 | /* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */ |
600 | 599 | ||
601 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 600 | switch (obj_desc->common.type) { |
602 | case ACPI_TYPE_BUFFER: | 601 | case ACPI_TYPE_BUFFER: |
603 | case ACPI_TYPE_REGION: | 602 | case ACPI_TYPE_REGION: |
604 | 603 | ||
@@ -619,7 +618,7 @@ acpi_ex_resolve_operands(u16 opcode, | |||
619 | 618 | ||
620 | /* Used by the Store() operator only */ | 619 | /* Used by the Store() operator only */ |
621 | 620 | ||
622 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 621 | switch (obj_desc->common.type) { |
623 | case ACPI_TYPE_INTEGER: | 622 | case ACPI_TYPE_INTEGER: |
624 | case ACPI_TYPE_PACKAGE: | 623 | case ACPI_TYPE_PACKAGE: |
625 | case ACPI_TYPE_STRING: | 624 | case ACPI_TYPE_STRING: |
@@ -677,8 +676,8 @@ acpi_ex_resolve_operands(u16 opcode, | |||
677 | * required object type (Simple cases only). | 676 | * required object type (Simple cases only). |
678 | */ | 677 | */ |
679 | status = acpi_ex_check_object_type(type_needed, | 678 | status = acpi_ex_check_object_type(type_needed, |
680 | ACPI_GET_OBJECT_TYPE | 679 | (*stack_ptr)->common.type, |
681 | (*stack_ptr), *stack_ptr); | 680 | *stack_ptr); |
682 | if (ACPI_FAILURE(status)) { | 681 | if (ACPI_FAILURE(status)) { |
683 | return_ACPI_STATUS(status); | 682 | return_ACPI_STATUS(status); |
684 | } | 683 | } |
diff --git a/drivers/acpi/acpica/exstore.c b/drivers/acpi/acpica/exstore.c index e35e9b4f6a4e..90d606196c99 100644 --- a/drivers/acpi/acpica/exstore.c +++ b/drivers/acpi/acpica/exstore.c | |||
@@ -129,7 +129,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, | |||
129 | 129 | ||
130 | /* source_desc is of type ACPI_DESC_TYPE_OPERAND */ | 130 | /* source_desc is of type ACPI_DESC_TYPE_OPERAND */ |
131 | 131 | ||
132 | switch (ACPI_GET_OBJECT_TYPE(source_desc)) { | 132 | switch (source_desc->common.type) { |
133 | case ACPI_TYPE_INTEGER: | 133 | case ACPI_TYPE_INTEGER: |
134 | 134 | ||
135 | /* Output correct integer width */ | 135 | /* Output correct integer width */ |
@@ -324,7 +324,7 @@ acpi_ex_store(union acpi_operand_object *source_desc, | |||
324 | 324 | ||
325 | /* Destination object must be a Reference or a Constant object */ | 325 | /* Destination object must be a Reference or a Constant object */ |
326 | 326 | ||
327 | switch (ACPI_GET_OBJECT_TYPE(dest_desc)) { | 327 | switch (dest_desc->common.type) { |
328 | case ACPI_TYPE_LOCAL_REFERENCE: | 328 | case ACPI_TYPE_LOCAL_REFERENCE: |
329 | break; | 329 | break; |
330 | 330 | ||
@@ -460,9 +460,8 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc, | |||
460 | */ | 460 | */ |
461 | obj_desc = *(index_desc->reference.where); | 461 | obj_desc = *(index_desc->reference.where); |
462 | 462 | ||
463 | if (ACPI_GET_OBJECT_TYPE(source_desc) == | 463 | if (source_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE && |
464 | ACPI_TYPE_LOCAL_REFERENCE | 464 | source_desc->reference.class == ACPI_REFCLASS_TABLE) { |
465 | && source_desc->reference.class == ACPI_REFCLASS_TABLE) { | ||
466 | 465 | ||
467 | /* This is a DDBHandle, just add a reference to it */ | 466 | /* This is a DDBHandle, just add a reference to it */ |
468 | 467 | ||
@@ -520,8 +519,8 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc, | |||
520 | * by the INDEX_OP code. | 519 | * by the INDEX_OP code. |
521 | */ | 520 | */ |
522 | obj_desc = index_desc->reference.object; | 521 | obj_desc = index_desc->reference.object; |
523 | if ((ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_BUFFER) && | 522 | if ((obj_desc->common.type != ACPI_TYPE_BUFFER) && |
524 | (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_STRING)) { | 523 | (obj_desc->common.type != ACPI_TYPE_STRING)) { |
525 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 524 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
526 | } | 525 | } |
527 | 526 | ||
@@ -529,7 +528,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc, | |||
529 | * The assignment of the individual elements will be slightly | 528 | * The assignment of the individual elements will be slightly |
530 | * different for each source type. | 529 | * different for each source type. |
531 | */ | 530 | */ |
532 | switch (ACPI_GET_OBJECT_TYPE(source_desc)) { | 531 | switch (source_desc->common.type) { |
533 | case ACPI_TYPE_INTEGER: | 532 | case ACPI_TYPE_INTEGER: |
534 | 533 | ||
535 | /* Use the least-significant byte of the integer */ | 534 | /* Use the least-significant byte of the integer */ |
@@ -707,8 +706,7 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc, | |||
707 | /* No conversions for all other types. Just attach the source object */ | 706 | /* No conversions for all other types. Just attach the source object */ |
708 | 707 | ||
709 | status = acpi_ns_attach_object(node, source_desc, | 708 | status = acpi_ns_attach_object(node, source_desc, |
710 | ACPI_GET_OBJECT_TYPE | 709 | source_desc->common.type); |
711 | (source_desc)); | ||
712 | break; | 710 | break; |
713 | } | 711 | } |
714 | 712 | ||
diff --git a/drivers/acpi/acpica/exstoren.c b/drivers/acpi/acpica/exstoren.c index 145d15305f70..608e838d537e 100644 --- a/drivers/acpi/acpica/exstoren.c +++ b/drivers/acpi/acpica/exstoren.c | |||
@@ -96,8 +96,7 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr, | |||
96 | * are all essentially the same. This case handles the | 96 | * are all essentially the same. This case handles the |
97 | * "interchangeable" types Integer, String, and Buffer. | 97 | * "interchangeable" types Integer, String, and Buffer. |
98 | */ | 98 | */ |
99 | if (ACPI_GET_OBJECT_TYPE(source_desc) == | 99 | if (source_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE) { |
100 | ACPI_TYPE_LOCAL_REFERENCE) { | ||
101 | 100 | ||
102 | /* Resolve a reference object first */ | 101 | /* Resolve a reference object first */ |
103 | 102 | ||
@@ -117,13 +116,11 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr, | |||
117 | 116 | ||
118 | /* Must have a Integer, Buffer, or String */ | 117 | /* Must have a Integer, Buffer, or String */ |
119 | 118 | ||
120 | if ((ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_INTEGER) && | 119 | if ((source_desc->common.type != ACPI_TYPE_INTEGER) && |
121 | (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_BUFFER) && | 120 | (source_desc->common.type != ACPI_TYPE_BUFFER) && |
122 | (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_STRING) && | 121 | (source_desc->common.type != ACPI_TYPE_STRING) && |
123 | !((ACPI_GET_OBJECT_TYPE(source_desc) == | 122 | !((source_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE) && |
124 | ACPI_TYPE_LOCAL_REFERENCE) | 123 | (source_desc->reference.class == ACPI_REFCLASS_TABLE))) { |
125 | && (source_desc->reference.class == | ||
126 | ACPI_REFCLASS_TABLE))) { | ||
127 | 124 | ||
128 | /* Conversion successful but still not a valid type */ | 125 | /* Conversion successful but still not a valid type */ |
129 | 126 | ||
@@ -218,8 +215,7 @@ acpi_ex_store_object_to_object(union acpi_operand_object *source_desc, | |||
218 | return_ACPI_STATUS(status); | 215 | return_ACPI_STATUS(status); |
219 | } | 216 | } |
220 | 217 | ||
221 | if (ACPI_GET_OBJECT_TYPE(source_desc) != | 218 | if (source_desc->common.type != dest_desc->common.type) { |
222 | ACPI_GET_OBJECT_TYPE(dest_desc)) { | ||
223 | /* | 219 | /* |
224 | * The source type does not match the type of the destination. | 220 | * The source type does not match the type of the destination. |
225 | * Perform the "implicit conversion" of the source to the current type | 221 | * Perform the "implicit conversion" of the source to the current type |
@@ -229,11 +225,10 @@ acpi_ex_store_object_to_object(union acpi_operand_object *source_desc, | |||
229 | * Otherwise, actual_src_desc is a temporary object to hold the | 225 | * Otherwise, actual_src_desc is a temporary object to hold the |
230 | * converted object. | 226 | * converted object. |
231 | */ | 227 | */ |
232 | status = | 228 | status = acpi_ex_convert_to_target_type(dest_desc->common.type, |
233 | acpi_ex_convert_to_target_type(ACPI_GET_OBJECT_TYPE | 229 | source_desc, |
234 | (dest_desc), source_desc, | 230 | &actual_src_desc, |
235 | &actual_src_desc, | 231 | walk_state); |
236 | walk_state); | ||
237 | if (ACPI_FAILURE(status)) { | 232 | if (ACPI_FAILURE(status)) { |
238 | return_ACPI_STATUS(status); | 233 | return_ACPI_STATUS(status); |
239 | } | 234 | } |
@@ -252,7 +247,7 @@ acpi_ex_store_object_to_object(union acpi_operand_object *source_desc, | |||
252 | * We now have two objects of identical types, and we can perform a | 247 | * We now have two objects of identical types, and we can perform a |
253 | * copy of the *value* of the source object. | 248 | * copy of the *value* of the source object. |
254 | */ | 249 | */ |
255 | switch (ACPI_GET_OBJECT_TYPE(dest_desc)) { | 250 | switch (dest_desc->common.type) { |
256 | case ACPI_TYPE_INTEGER: | 251 | case ACPI_TYPE_INTEGER: |
257 | 252 | ||
258 | dest_desc->integer.value = actual_src_desc->integer.value; | 253 | dest_desc->integer.value = actual_src_desc->integer.value; |
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c index 32b85d68e756..87730e944132 100644 --- a/drivers/acpi/acpica/exutils.c +++ b/drivers/acpi/acpica/exutils.c | |||
@@ -221,7 +221,7 @@ void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc) | |||
221 | */ | 221 | */ |
222 | if ((!obj_desc) || | 222 | if ((!obj_desc) || |
223 | (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) || | 223 | (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) || |
224 | (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_INTEGER)) { | 224 | (obj_desc->common.type != ACPI_TYPE_INTEGER)) { |
225 | return; | 225 | return; |
226 | } | 226 | } |
227 | 227 | ||
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c index f67562ea0010..4df9eacb7c88 100644 --- a/drivers/acpi/acpica/hwxface.c +++ b/drivers/acpi/acpica/hwxface.c | |||
@@ -532,7 +532,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b) | |||
532 | 532 | ||
533 | /* It must be of type Package */ | 533 | /* It must be of type Package */ |
534 | 534 | ||
535 | else if (ACPI_GET_OBJECT_TYPE(info->return_object) != ACPI_TYPE_PACKAGE) { | 535 | else if (info->return_object->common.type != ACPI_TYPE_PACKAGE) { |
536 | ACPI_ERROR((AE_INFO, | 536 | ACPI_ERROR((AE_INFO, |
537 | "Sleep State return object is not a Package")); | 537 | "Sleep State return object is not a Package")); |
538 | status = AE_AML_OPERAND_TYPE; | 538 | status = AE_AML_OPERAND_TYPE; |
@@ -553,9 +553,9 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b) | |||
553 | 553 | ||
554 | /* The first two elements must both be of type Integer */ | 554 | /* The first two elements must both be of type Integer */ |
555 | 555 | ||
556 | else if ((ACPI_GET_OBJECT_TYPE(info->return_object->package.elements[0]) | 556 | else if (((info->return_object->package.elements[0])->common.type |
557 | != ACPI_TYPE_INTEGER) || | 557 | != ACPI_TYPE_INTEGER) || |
558 | (ACPI_GET_OBJECT_TYPE(info->return_object->package.elements[1]) | 558 | ((info->return_object->package.elements[1])->common.type |
559 | != ACPI_TYPE_INTEGER)) { | 559 | != ACPI_TYPE_INTEGER)) { |
560 | ACPI_ERROR((AE_INFO, | 560 | ACPI_ERROR((AE_INFO, |
561 | "Sleep State return package elements are not both Integers (%s, %s)", | 561 | "Sleep State return package elements are not both Integers (%s, %s)", |
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c index 88303ebe924c..b6968a65cd4f 100644 --- a/drivers/acpi/acpica/nsaccess.c +++ b/drivers/acpi/acpica/nsaccess.c | |||
@@ -234,8 +234,7 @@ acpi_status acpi_ns_root_initialize(void) | |||
234 | /* Store pointer to value descriptor in the Node */ | 234 | /* Store pointer to value descriptor in the Node */ |
235 | 235 | ||
236 | status = acpi_ns_attach_object(new_node, obj_desc, | 236 | status = acpi_ns_attach_object(new_node, obj_desc, |
237 | ACPI_GET_OBJECT_TYPE | 237 | obj_desc->common.type); |
238 | (obj_desc)); | ||
239 | 238 | ||
240 | /* Remove local reference to the object */ | 239 | /* Remove local reference to the object */ |
241 | 240 | ||
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c index e96d37a596b8..7bfa6c1286f1 100644 --- a/drivers/acpi/acpica/nsdump.c +++ b/drivers/acpi/acpica/nsdump.c | |||
@@ -515,7 +515,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, | |||
515 | 515 | ||
516 | case ACPI_DESC_TYPE_OPERAND: | 516 | case ACPI_DESC_TYPE_OPERAND: |
517 | 517 | ||
518 | obj_type = ACPI_GET_OBJECT_TYPE(obj_desc); | 518 | obj_type = obj_desc->common.type; |
519 | 519 | ||
520 | if (obj_type > ACPI_TYPE_LOCAL_MAX) { | 520 | if (obj_type > ACPI_TYPE_LOCAL_MAX) { |
521 | acpi_os_printf | 521 | acpi_os_printf |
diff --git a/drivers/acpi/acpica/nsobject.c b/drivers/acpi/acpica/nsobject.c index 08a97a57f8f9..3eb20bfda9d8 100644 --- a/drivers/acpi/acpica/nsobject.c +++ b/drivers/acpi/acpica/nsobject.c | |||
@@ -209,8 +209,7 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node) | |||
209 | 209 | ||
210 | obj_desc = node->object; | 210 | obj_desc = node->object; |
211 | 211 | ||
212 | if (!obj_desc || | 212 | if (!obj_desc || (obj_desc->common.type == ACPI_TYPE_LOCAL_DATA)) { |
213 | (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_DATA)) { | ||
214 | return_VOID; | 213 | return_VOID; |
215 | } | 214 | } |
216 | 215 | ||
@@ -220,8 +219,7 @@ void acpi_ns_detach_object(struct acpi_namespace_node *node) | |||
220 | if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_OPERAND) { | 219 | if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_OPERAND) { |
221 | node->object = obj_desc->common.next_object; | 220 | node->object = obj_desc->common.next_object; |
222 | if (node->object && | 221 | if (node->object && |
223 | (ACPI_GET_OBJECT_TYPE(node->object) != | 222 | ((node->object)->common.type != ACPI_TYPE_LOCAL_DATA)) { |
224 | ACPI_TYPE_LOCAL_DATA)) { | ||
225 | node->object = node->object->common.next_object; | 223 | node->object = node->object->common.next_object; |
226 | } | 224 | } |
227 | } | 225 | } |
@@ -267,7 +265,7 @@ union acpi_operand_object *acpi_ns_get_attached_object(struct | |||
267 | ((ACPI_GET_DESCRIPTOR_TYPE(node->object) != ACPI_DESC_TYPE_OPERAND) | 265 | ((ACPI_GET_DESCRIPTOR_TYPE(node->object) != ACPI_DESC_TYPE_OPERAND) |
268 | && (ACPI_GET_DESCRIPTOR_TYPE(node->object) != | 266 | && (ACPI_GET_DESCRIPTOR_TYPE(node->object) != |
269 | ACPI_DESC_TYPE_NAMED)) | 267 | ACPI_DESC_TYPE_NAMED)) |
270 | || (ACPI_GET_OBJECT_TYPE(node->object) == ACPI_TYPE_LOCAL_DATA)) { | 268 | || ((node->object)->common.type == ACPI_TYPE_LOCAL_DATA)) { |
271 | return_PTR(NULL); | 269 | return_PTR(NULL); |
272 | } | 270 | } |
273 | 271 | ||
@@ -294,9 +292,9 @@ union acpi_operand_object *acpi_ns_get_secondary_object(union | |||
294 | ACPI_FUNCTION_TRACE_PTR(ns_get_secondary_object, obj_desc); | 292 | ACPI_FUNCTION_TRACE_PTR(ns_get_secondary_object, obj_desc); |
295 | 293 | ||
296 | if ((!obj_desc) || | 294 | if ((!obj_desc) || |
297 | (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_DATA) || | 295 | (obj_desc->common.type == ACPI_TYPE_LOCAL_DATA) || |
298 | (!obj_desc->common.next_object) || | 296 | (!obj_desc->common.next_object) || |
299 | (ACPI_GET_OBJECT_TYPE(obj_desc->common.next_object) == | 297 | ((obj_desc->common.next_object)->common.type == |
300 | ACPI_TYPE_LOCAL_DATA)) { | 298 | ACPI_TYPE_LOCAL_DATA)) { |
301 | return_PTR(NULL); | 299 | return_PTR(NULL); |
302 | } | 300 | } |
@@ -331,7 +329,7 @@ acpi_ns_attach_data(struct acpi_namespace_node *node, | |||
331 | prev_obj_desc = NULL; | 329 | prev_obj_desc = NULL; |
332 | obj_desc = node->object; | 330 | obj_desc = node->object; |
333 | while (obj_desc) { | 331 | while (obj_desc) { |
334 | if ((ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_DATA) && | 332 | if ((obj_desc->common.type == ACPI_TYPE_LOCAL_DATA) && |
335 | (obj_desc->data.handler == handler)) { | 333 | (obj_desc->data.handler == handler)) { |
336 | return (AE_ALREADY_EXISTS); | 334 | return (AE_ALREADY_EXISTS); |
337 | } | 335 | } |
@@ -385,7 +383,7 @@ acpi_ns_detach_data(struct acpi_namespace_node * node, | |||
385 | prev_obj_desc = NULL; | 383 | prev_obj_desc = NULL; |
386 | obj_desc = node->object; | 384 | obj_desc = node->object; |
387 | while (obj_desc) { | 385 | while (obj_desc) { |
388 | if ((ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_DATA) && | 386 | if ((obj_desc->common.type == ACPI_TYPE_LOCAL_DATA) && |
389 | (obj_desc->data.handler == handler)) { | 387 | (obj_desc->data.handler == handler)) { |
390 | if (prev_obj_desc) { | 388 | if (prev_obj_desc) { |
391 | prev_obj_desc->common.next_object = | 389 | prev_obj_desc->common.next_object = |
@@ -428,7 +426,7 @@ acpi_ns_get_attached_data(struct acpi_namespace_node * node, | |||
428 | 426 | ||
429 | obj_desc = node->object; | 427 | obj_desc = node->object; |
430 | while (obj_desc) { | 428 | while (obj_desc) { |
431 | if ((ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_DATA) && | 429 | if ((obj_desc->common.type == ACPI_TYPE_LOCAL_DATA) && |
432 | (obj_desc->data.handler == handler)) { | 430 | (obj_desc->data.handler == handler)) { |
433 | *data = obj_desc->data.pointer; | 431 | *data = obj_desc->data.pointer; |
434 | return (AE_OK); | 432 | return (AE_OK); |
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c index 452703290d35..72dd7b198520 100644 --- a/drivers/acpi/acpica/nspredef.c +++ b/drivers/acpi/acpica/nspredef.c | |||
@@ -221,7 +221,7 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node, | |||
221 | 221 | ||
222 | /* For returned Package objects, check the type of all sub-objects */ | 222 | /* For returned Package objects, check the type of all sub-objects */ |
223 | 223 | ||
224 | if (ACPI_GET_OBJECT_TYPE(return_object) == ACPI_TYPE_PACKAGE) { | 224 | if (return_object->common.type == ACPI_TYPE_PACKAGE) { |
225 | status = | 225 | status = |
226 | acpi_ns_check_package(pathname, return_object_ptr, | 226 | acpi_ns_check_package(pathname, return_object_ptr, |
227 | predefined); | 227 | predefined); |
@@ -858,7 +858,7 @@ acpi_ns_check_object_type(char *pathname, | |||
858 | * from all of the predefined names (including elements of returned | 858 | * from all of the predefined names (including elements of returned |
859 | * packages) | 859 | * packages) |
860 | */ | 860 | */ |
861 | switch (ACPI_GET_OBJECT_TYPE(return_object)) { | 861 | switch (return_object->common.type) { |
862 | case ACPI_TYPE_INTEGER: | 862 | case ACPI_TYPE_INTEGER: |
863 | return_btype = ACPI_RTYPE_INTEGER; | 863 | return_btype = ACPI_RTYPE_INTEGER; |
864 | break; | 864 | break; |
@@ -901,7 +901,7 @@ acpi_ns_check_object_type(char *pathname, | |||
901 | 901 | ||
902 | /* For reference objects, check that the reference type is correct */ | 902 | /* For reference objects, check that the reference type is correct */ |
903 | 903 | ||
904 | if (ACPI_GET_OBJECT_TYPE(return_object) == ACPI_TYPE_LOCAL_REFERENCE) { | 904 | if (return_object->common.type == ACPI_TYPE_LOCAL_REFERENCE) { |
905 | status = acpi_ns_check_reference(pathname, return_object); | 905 | status = acpi_ns_check_reference(pathname, return_object); |
906 | } | 906 | } |
907 | 907 | ||
@@ -1006,7 +1006,7 @@ acpi_ns_repair_object(u32 expected_btypes, | |||
1006 | union acpi_operand_object *new_object; | 1006 | union acpi_operand_object *new_object; |
1007 | acpi_size length; | 1007 | acpi_size length; |
1008 | 1008 | ||
1009 | switch (ACPI_GET_OBJECT_TYPE(return_object)) { | 1009 | switch (return_object->common.type) { |
1010 | case ACPI_TYPE_BUFFER: | 1010 | case ACPI_TYPE_BUFFER: |
1011 | 1011 | ||
1012 | if (!(expected_btypes & ACPI_RTYPE_STRING)) { | 1012 | if (!(expected_btypes & ACPI_RTYPE_STRING)) { |
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c index 22a7171ac1ed..2583a66a60a7 100644 --- a/drivers/acpi/acpica/nsxfeval.c +++ b/drivers/acpi/acpica/nsxfeval.c | |||
@@ -387,8 +387,7 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info) | |||
387 | 387 | ||
388 | /* We are interested in reference objects only */ | 388 | /* We are interested in reference objects only */ |
389 | 389 | ||
390 | if (ACPI_GET_OBJECT_TYPE(info->return_object) != | 390 | if ((info->return_object)->common.type != ACPI_TYPE_LOCAL_REFERENCE) { |
391 | ACPI_TYPE_LOCAL_REFERENCE) { | ||
392 | return; | 391 | return; |
393 | } | 392 | } |
394 | 393 | ||
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c index 52865ee6bc77..b6667ff059e5 100644 --- a/drivers/acpi/acpica/rscalc.c +++ b/drivers/acpi/acpica/rscalc.c | |||
@@ -557,9 +557,9 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, | |||
557 | table_index++) { | 557 | table_index++) { |
558 | if (*sub_object_list && /* Null object allowed */ | 558 | if (*sub_object_list && /* Null object allowed */ |
559 | ((ACPI_TYPE_STRING == | 559 | ((ACPI_TYPE_STRING == |
560 | ACPI_GET_OBJECT_TYPE(*sub_object_list)) || | 560 | (*sub_object_list)->common.type) || |
561 | ((ACPI_TYPE_LOCAL_REFERENCE == | 561 | ((ACPI_TYPE_LOCAL_REFERENCE == |
562 | ACPI_GET_OBJECT_TYPE(*sub_object_list)) && | 562 | (*sub_object_list)->common.type) && |
563 | ((*sub_object_list)->reference.class == | 563 | ((*sub_object_list)->reference.class == |
564 | ACPI_REFCLASS_NAME)))) { | 564 | ACPI_REFCLASS_NAME)))) { |
565 | name_found = TRUE; | 565 | name_found = TRUE; |
@@ -575,8 +575,7 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, | |||
575 | /* Was a String type found? */ | 575 | /* Was a String type found? */ |
576 | 576 | ||
577 | if (name_found) { | 577 | if (name_found) { |
578 | if (ACPI_GET_OBJECT_TYPE(*sub_object_list) == | 578 | if ((*sub_object_list)->common.type == ACPI_TYPE_STRING) { |
579 | ACPI_TYPE_STRING) { | ||
580 | /* | 579 | /* |
581 | * The length String.Length field does not include the | 580 | * The length String.Length field does not include the |
582 | * terminating NULL, add 1 | 581 | * terminating NULL, add 1 |
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c index 61566b1a0616..663f692fffcf 100644 --- a/drivers/acpi/acpica/rscreate.c +++ b/drivers/acpi/acpica/rscreate.c | |||
@@ -212,7 +212,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
212 | 212 | ||
213 | /* Each element of the top-level package must also be a package */ | 213 | /* Each element of the top-level package must also be a package */ |
214 | 214 | ||
215 | if (ACPI_GET_OBJECT_TYPE(*top_object_list) != ACPI_TYPE_PACKAGE) { | 215 | if ((*top_object_list)->common.type != ACPI_TYPE_PACKAGE) { |
216 | ACPI_ERROR((AE_INFO, | 216 | ACPI_ERROR((AE_INFO, |
217 | "(PRT[%X]) Need sub-package, found %s", | 217 | "(PRT[%X]) Need sub-package, found %s", |
218 | index, | 218 | index, |
@@ -240,7 +240,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
240 | /* 1) First subobject: Dereference the PRT.Address */ | 240 | /* 1) First subobject: Dereference the PRT.Address */ |
241 | 241 | ||
242 | obj_desc = sub_object_list[0]; | 242 | obj_desc = sub_object_list[0]; |
243 | if (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_INTEGER) { | 243 | if (obj_desc->common.type != ACPI_TYPE_INTEGER) { |
244 | ACPI_ERROR((AE_INFO, | 244 | ACPI_ERROR((AE_INFO, |
245 | "(PRT[%X].Address) Need Integer, found %s", | 245 | "(PRT[%X].Address) Need Integer, found %s", |
246 | index, | 246 | index, |
@@ -253,7 +253,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
253 | /* 2) Second subobject: Dereference the PRT.Pin */ | 253 | /* 2) Second subobject: Dereference the PRT.Pin */ |
254 | 254 | ||
255 | obj_desc = sub_object_list[1]; | 255 | obj_desc = sub_object_list[1]; |
256 | if (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_INTEGER) { | 256 | if (obj_desc->common.type != ACPI_TYPE_INTEGER) { |
257 | ACPI_ERROR((AE_INFO, | 257 | ACPI_ERROR((AE_INFO, |
258 | "(PRT[%X].Pin) Need Integer, found %s", | 258 | "(PRT[%X].Pin) Need Integer, found %s", |
259 | index, | 259 | index, |
@@ -265,7 +265,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
265 | * If BIOS erroneously reversed the _PRT source_name and source_index, | 265 | * If BIOS erroneously reversed the _PRT source_name and source_index, |
266 | * then reverse them back. | 266 | * then reverse them back. |
267 | */ | 267 | */ |
268 | if (ACPI_GET_OBJECT_TYPE(sub_object_list[3]) != | 268 | if ((sub_object_list[3])->common.type != |
269 | ACPI_TYPE_INTEGER) { | 269 | ACPI_TYPE_INTEGER) { |
270 | if (acpi_gbl_enable_interpreter_slack) { | 270 | if (acpi_gbl_enable_interpreter_slack) { |
271 | source_name_index = 3; | 271 | source_name_index = 3; |
@@ -291,8 +291,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
291 | * other ACPI implementations. | 291 | * other ACPI implementations. |
292 | */ | 292 | */ |
293 | obj_desc = sub_object_list[3]; | 293 | obj_desc = sub_object_list[3]; |
294 | if (!obj_desc | 294 | if (!obj_desc || (obj_desc->common.type != ACPI_TYPE_INTEGER)) { |
295 | || (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_INTEGER)) { | ||
296 | sub_object_list[3] = sub_object_list[2]; | 295 | sub_object_list[3] = sub_object_list[2]; |
297 | sub_object_list[2] = obj_desc; | 296 | sub_object_list[2] = obj_desc; |
298 | 297 | ||
@@ -307,7 +306,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
307 | */ | 306 | */ |
308 | obj_desc = sub_object_list[source_name_index]; | 307 | obj_desc = sub_object_list[source_name_index]; |
309 | if (obj_desc) { | 308 | if (obj_desc) { |
310 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 309 | switch (obj_desc->common.type) { |
311 | case ACPI_TYPE_LOCAL_REFERENCE: | 310 | case ACPI_TYPE_LOCAL_REFERENCE: |
312 | 311 | ||
313 | if (obj_desc->reference.class != | 312 | if (obj_desc->reference.class != |
@@ -380,7 +379,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
380 | /* 4) Fourth subobject: Dereference the PRT.source_index */ | 379 | /* 4) Fourth subobject: Dereference the PRT.source_index */ |
381 | 380 | ||
382 | obj_desc = sub_object_list[source_index_index]; | 381 | obj_desc = sub_object_list[source_index_index]; |
383 | if (ACPI_GET_OBJECT_TYPE(obj_desc) != ACPI_TYPE_INTEGER) { | 382 | if (obj_desc->common.type != ACPI_TYPE_INTEGER) { |
384 | ACPI_ERROR((AE_INFO, | 383 | ACPI_ERROR((AE_INFO, |
385 | "(PRT[%X].SourceIndex) Need Integer, found %s", | 384 | "(PRT[%X].SourceIndex) Need Integer, found %s", |
386 | index, | 385 | index, |
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c index b0dcfd3c872a..cabe860ce007 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) |
@@ -697,7 +697,7 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, | |||
697 | 697 | ||
698 | /* Handle the objects with extra data */ | 698 | /* Handle the objects with extra data */ |
699 | 699 | ||
700 | switch (ACPI_GET_OBJECT_TYPE(dest_desc)) { | 700 | switch (dest_desc->common.type) { |
701 | case ACPI_TYPE_BUFFER: | 701 | case ACPI_TYPE_BUFFER: |
702 | /* | 702 | /* |
703 | * Allocate and copy the actual buffer if and only if: | 703 | * Allocate and copy the actual buffer if and only if: |
@@ -814,8 +814,8 @@ acpi_ut_copy_ielement_to_ielement(u8 object_type, | |||
814 | * This is a simple object, just copy it | 814 | * This is a simple object, just copy it |
815 | */ | 815 | */ |
816 | target_object = | 816 | target_object = |
817 | acpi_ut_create_internal_object(ACPI_GET_OBJECT_TYPE | 817 | acpi_ut_create_internal_object(source_object-> |
818 | (source_object)); | 818 | common.type); |
819 | if (!target_object) { | 819 | if (!target_object) { |
820 | return (AE_NO_MEMORY); | 820 | return (AE_NO_MEMORY); |
821 | } | 821 | } |
@@ -892,7 +892,7 @@ acpi_ut_copy_ipackage_to_ipackage(union acpi_operand_object *source_obj, | |||
892 | 892 | ||
893 | ACPI_FUNCTION_TRACE(ut_copy_ipackage_to_ipackage); | 893 | ACPI_FUNCTION_TRACE(ut_copy_ipackage_to_ipackage); |
894 | 894 | ||
895 | dest_obj->common.type = ACPI_GET_OBJECT_TYPE(source_obj); | 895 | dest_obj->common.type = source_obj->common.type; |
896 | dest_obj->common.flags = source_obj->common.flags; | 896 | dest_obj->common.flags = source_obj->common.flags; |
897 | dest_obj->package.count = source_obj->package.count; | 897 | dest_obj->package.count = source_obj->package.count; |
898 | 898 | ||
@@ -950,15 +950,14 @@ acpi_ut_copy_iobject_to_iobject(union acpi_operand_object *source_desc, | |||
950 | 950 | ||
951 | /* Create the top level object */ | 951 | /* Create the top level object */ |
952 | 952 | ||
953 | *dest_desc = | 953 | *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) { | 954 | if (!*dest_desc) { |
956 | return_ACPI_STATUS(AE_NO_MEMORY); | 955 | return_ACPI_STATUS(AE_NO_MEMORY); |
957 | } | 956 | } |
958 | 957 | ||
959 | /* Copy the object and possible subobjects */ | 958 | /* Copy the object and possible subobjects */ |
960 | 959 | ||
961 | if (ACPI_GET_OBJECT_TYPE(source_desc) == ACPI_TYPE_PACKAGE) { | 960 | if (source_desc->common.type == ACPI_TYPE_PACKAGE) { |
962 | status = | 961 | status = |
963 | acpi_ut_copy_ipackage_to_ipackage(source_desc, *dest_desc, | 962 | acpi_ut_copy_ipackage_to_ipackage(source_desc, *dest_desc, |
964 | walk_state); | 963 | walk_state); |
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c index a0be9e39531e..a5ee23bc4f55 100644 --- a/drivers/acpi/acpica/utdelete.c +++ b/drivers/acpi/acpica/utdelete.c | |||
@@ -86,7 +86,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object) | |||
86 | * Must delete or free any pointers within the object that are not | 86 | * Must delete or free any pointers within the object that are not |
87 | * actual ACPI objects (for example, a raw buffer pointer). | 87 | * actual ACPI objects (for example, a raw buffer pointer). |
88 | */ | 88 | */ |
89 | switch (ACPI_GET_OBJECT_TYPE(object)) { | 89 | switch (object->common.type) { |
90 | case ACPI_TYPE_STRING: | 90 | case ACPI_TYPE_STRING: |
91 | 91 | ||
92 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, | 92 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, |
@@ -382,7 +382,7 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action) | |||
382 | object, new_count)); | 382 | object, new_count)); |
383 | } | 383 | } |
384 | 384 | ||
385 | if (ACPI_GET_OBJECT_TYPE(object) == ACPI_TYPE_METHOD) { | 385 | if (object->common.type == ACPI_TYPE_METHOD) { |
386 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, | 386 | ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, |
387 | "Method Obj %p Refs=%X, [Decremented]\n", | 387 | "Method Obj %p Refs=%X, [Decremented]\n", |
388 | object, new_count)); | 388 | object, new_count)); |
@@ -469,7 +469,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) | |||
469 | * All sub-objects must have their reference count incremented also. | 469 | * All sub-objects must have their reference count incremented also. |
470 | * Different object types have different subobjects. | 470 | * Different object types have different subobjects. |
471 | */ | 471 | */ |
472 | switch (ACPI_GET_OBJECT_TYPE(object)) { | 472 | switch (object->common.type) { |
473 | case ACPI_TYPE_DEVICE: | 473 | case ACPI_TYPE_DEVICE: |
474 | case ACPI_TYPE_PROCESSOR: | 474 | case ACPI_TYPE_PROCESSOR: |
475 | case ACPI_TYPE_POWER: | 475 | case ACPI_TYPE_POWER: |
diff --git a/drivers/acpi/acpica/uteval.c b/drivers/acpi/acpica/uteval.c index 9c9897dbe907..99bfbd23258b 100644 --- a/drivers/acpi/acpica/uteval.c +++ b/drivers/acpi/acpica/uteval.c | |||
@@ -248,7 +248,7 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node, | |||
248 | 248 | ||
249 | /* Map the return object type to the bitmapped type */ | 249 | /* Map the return object type to the bitmapped type */ |
250 | 250 | ||
251 | switch (ACPI_GET_OBJECT_TYPE(info->return_object)) { | 251 | switch ((info->return_object)->common.type) { |
252 | case ACPI_TYPE_INTEGER: | 252 | case ACPI_TYPE_INTEGER: |
253 | return_btype = ACPI_BTYPE_INTEGER; | 253 | return_btype = ACPI_BTYPE_INTEGER; |
254 | break; | 254 | break; |
@@ -418,7 +418,7 @@ acpi_ut_execute_HID(struct acpi_namespace_node *device_node, | |||
418 | return_ACPI_STATUS(status); | 418 | return_ACPI_STATUS(status); |
419 | } | 419 | } |
420 | 420 | ||
421 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { | 421 | if (obj_desc->common.type == ACPI_TYPE_INTEGER) { |
422 | 422 | ||
423 | /* Convert the Numeric HID to string */ | 423 | /* Convert the Numeric HID to string */ |
424 | 424 | ||
@@ -459,7 +459,7 @@ acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc, | |||
459 | struct acpi_compatible_id *one_cid) | 459 | struct acpi_compatible_id *one_cid) |
460 | { | 460 | { |
461 | 461 | ||
462 | switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { | 462 | switch (obj_desc->common.type) { |
463 | case ACPI_TYPE_INTEGER: | 463 | case ACPI_TYPE_INTEGER: |
464 | 464 | ||
465 | /* Convert the Numeric CID to string */ | 465 | /* Convert the Numeric CID to string */ |
@@ -527,7 +527,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node * device_node, | |||
527 | /* Get the number of _CIDs returned */ | 527 | /* Get the number of _CIDs returned */ |
528 | 528 | ||
529 | count = 1; | 529 | count = 1; |
530 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_PACKAGE) { | 530 | if (obj_desc->common.type == ACPI_TYPE_PACKAGE) { |
531 | count = obj_desc->package.count; | 531 | count = obj_desc->package.count; |
532 | } | 532 | } |
533 | 533 | ||
@@ -555,7 +555,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node * device_node, | |||
555 | 555 | ||
556 | /* The _CID object can be either a single CID or a package (list) of CIDs */ | 556 | /* The _CID object can be either a single CID or a package (list) of CIDs */ |
557 | 557 | ||
558 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_PACKAGE) { | 558 | if (obj_desc->common.type == ACPI_TYPE_PACKAGE) { |
559 | 559 | ||
560 | /* Translate each package element */ | 560 | /* Translate each package element */ |
561 | 561 | ||
@@ -620,7 +620,7 @@ acpi_ut_execute_UID(struct acpi_namespace_node *device_node, | |||
620 | return_ACPI_STATUS(status); | 620 | return_ACPI_STATUS(status); |
621 | } | 621 | } |
622 | 622 | ||
623 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { | 623 | if (obj_desc->common.type == ACPI_TYPE_INTEGER) { |
624 | 624 | ||
625 | /* Convert the Numeric UID to string */ | 625 | /* Convert the Numeric UID to string */ |
626 | 626 | ||
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c index bec0e21673cb..7fc35d33adb1 100644 --- a/drivers/acpi/acpica/utglobal.c +++ b/drivers/acpi/acpica/utglobal.c | |||
@@ -473,7 +473,7 @@ char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc) | |||
473 | return ("[NULL Object Descriptor]"); | 473 | return ("[NULL Object Descriptor]"); |
474 | } | 474 | } |
475 | 475 | ||
476 | return (acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE(obj_desc))); | 476 | return (acpi_ut_get_type_name(obj_desc->common.type)); |
477 | } | 477 | } |
478 | 478 | ||
479 | /******************************************************************************* | 479 | /******************************************************************************* |
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c index c1f7f4e1a72d..1c9e250caefb 100644 --- a/drivers/acpi/acpica/utmisc.c +++ b/drivers/acpi/acpica/utmisc.c | |||
@@ -938,8 +938,7 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object, | |||
938 | if ((!this_source_obj) || | 938 | if ((!this_source_obj) || |
939 | (ACPI_GET_DESCRIPTOR_TYPE(this_source_obj) != | 939 | (ACPI_GET_DESCRIPTOR_TYPE(this_source_obj) != |
940 | ACPI_DESC_TYPE_OPERAND) | 940 | ACPI_DESC_TYPE_OPERAND) |
941 | || (ACPI_GET_OBJECT_TYPE(this_source_obj) != | 941 | || (this_source_obj->common.type != ACPI_TYPE_PACKAGE)) { |
942 | ACPI_TYPE_PACKAGE)) { | ||
943 | status = | 942 | status = |
944 | walk_callback(ACPI_COPY_TYPE_SIMPLE, | 943 | walk_callback(ACPI_COPY_TYPE_SIMPLE, |
945 | this_source_obj, state, context); | 944 | this_source_obj, state, context); |
diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c index fd5ea7543e5b..ae337a717438 100644 --- a/drivers/acpi/acpica/utobject.c +++ b/drivers/acpi/acpica/utobject.c | |||
@@ -457,7 +457,7 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object, | |||
457 | * must be accessed bytewise or there may be alignment problems on | 457 | * must be accessed bytewise or there may be alignment problems on |
458 | * certain processors | 458 | * certain processors |
459 | */ | 459 | */ |
460 | switch (ACPI_GET_OBJECT_TYPE(internal_object)) { | 460 | switch (internal_object->common.type) { |
461 | case ACPI_TYPE_STRING: | 461 | case ACPI_TYPE_STRING: |
462 | 462 | ||
463 | length += (acpi_size) internal_object->string.length + 1; | 463 | length += (acpi_size) internal_object->string.length + 1; |
@@ -518,8 +518,7 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object, | |||
518 | ACPI_ERROR((AE_INFO, "Cannot convert to external object - " | 518 | ACPI_ERROR((AE_INFO, "Cannot convert to external object - " |
519 | "unsupported type [%s] %X in object %p", | 519 | "unsupported type [%s] %X in object %p", |
520 | acpi_ut_get_object_type_name(internal_object), | 520 | acpi_ut_get_object_type_name(internal_object), |
521 | ACPI_GET_OBJECT_TYPE(internal_object), | 521 | internal_object->common.type, internal_object)); |
522 | internal_object)); | ||
523 | status = AE_TYPE; | 522 | status = AE_TYPE; |
524 | break; | 523 | break; |
525 | } | 524 | } |
@@ -664,7 +663,7 @@ acpi_ut_get_object_size(union acpi_operand_object *internal_object, | |||
664 | 663 | ||
665 | if ((ACPI_GET_DESCRIPTOR_TYPE(internal_object) == | 664 | if ((ACPI_GET_DESCRIPTOR_TYPE(internal_object) == |
666 | ACPI_DESC_TYPE_OPERAND) | 665 | ACPI_DESC_TYPE_OPERAND) |
667 | && (ACPI_GET_OBJECT_TYPE(internal_object) == ACPI_TYPE_PACKAGE)) { | 666 | && (internal_object->common.type == ACPI_TYPE_PACKAGE)) { |
668 | status = | 667 | status = |
669 | acpi_ut_get_package_object_size(internal_object, | 668 | acpi_ut_get_package_object_size(internal_object, |
670 | obj_length); | 669 | obj_length); |