ACPICA: Standardize all switch() blocks

After many years, different formatting for switch() has crept in.
This change makes every switch block identical. Chao Guan.
ACPICA bugzilla 997.

References: https://bugs.acpica.org/show_bug.cgi?id=997
Signed-off-by: Chao Guan <chao.guan@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Chao Guan 2013-06-08 00:58:14 +00:00 committed by Rafael J. Wysocki
parent b6872ff9a4
commit 1d1ea1b723
71 changed files with 242 additions and 77 deletions

View File

@ -78,7 +78,6 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state,
switch (op->common.aml_opcode) { switch (op->common.aml_opcode) {
case AML_WHILE_OP: case AML_WHILE_OP:
/* /*
* If this is an additional iteration of a while loop, continue. * If this is an additional iteration of a while loop, continue.
* There is no need to allocate a new control state. * There is no need to allocate a new control state.
@ -99,7 +98,6 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state,
/*lint -fallthrough */ /*lint -fallthrough */
case AML_IF_OP: case AML_IF_OP:
/* /*
* IF/WHILE: Create a new control state to manage these * IF/WHILE: Create a new control state to manage these
* constructs. We need to manage these as a stack, in order * constructs. We need to manage these as a stack, in order
@ -142,6 +140,7 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state,
break; break;
default: default:
break; break;
} }
@ -344,6 +343,7 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
case AML_NOOP_OP: case AML_NOOP_OP:
/* Just do nothing! */ /* Just do nothing! */
break; break;
case AML_BREAK_POINT_OP: case AML_BREAK_POINT_OP:

View File

@ -563,21 +563,25 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
*/ */
switch (walk_state->opcode) { switch (walk_state->opcode) {
case AML_FIELD_OP: case AML_FIELD_OP:
arg = acpi_ps_get_arg(op, 2); arg = acpi_ps_get_arg(op, 2);
type = ACPI_TYPE_LOCAL_REGION_FIELD; type = ACPI_TYPE_LOCAL_REGION_FIELD;
break; break;
case AML_BANK_FIELD_OP: case AML_BANK_FIELD_OP:
arg = acpi_ps_get_arg(op, 4); arg = acpi_ps_get_arg(op, 4);
type = ACPI_TYPE_LOCAL_BANK_FIELD; type = ACPI_TYPE_LOCAL_BANK_FIELD;
break; break;
case AML_INDEX_FIELD_OP: case AML_INDEX_FIELD_OP:
arg = acpi_ps_get_arg(op, 3); arg = acpi_ps_get_arg(op, 3);
type = ACPI_TYPE_LOCAL_INDEX_FIELD; type = ACPI_TYPE_LOCAL_INDEX_FIELD;
break; break;
default: default:
return_ACPI_STATUS(AE_BAD_PARAMETER); return_ACPI_STATUS(AE_BAD_PARAMETER);
} }

View File

@ -127,6 +127,7 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
break; break;
default: default:
break; break;
} }

View File

@ -285,6 +285,7 @@ acpi_ds_method_data_get_node(u8 type,
break; break;
default: default:
ACPI_ERROR((AE_INFO, "Type %u is invalid", type)); ACPI_ERROR((AE_INFO, "Type %u is invalid", type));
return_ACPI_STATUS(AE_TYPE); return_ACPI_STATUS(AE_TYPE);
} }
@ -428,7 +429,6 @@ acpi_ds_method_data_get_value(u8 type,
return_ACPI_STATUS(AE_AML_UNINITIALIZED_ARG); return_ACPI_STATUS(AE_AML_UNINITIALIZED_ARG);
case ACPI_REFCLASS_LOCAL: case ACPI_REFCLASS_LOCAL:
/* /*
* No error message for this case, will be trapped again later to * No error message for this case, will be trapped again later to
* detect and ignore cases of Store(local_x,local_x) * detect and ignore cases of Store(local_x,local_x)

View File

@ -648,7 +648,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
switch (obj_desc->common.type) { switch (obj_desc->common.type) {
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
/* /*
* Defer evaluation of Buffer term_arg operand * Defer evaluation of Buffer term_arg operand
*/ */
@ -660,7 +659,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
break; break;
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
/* /*
* Defer evaluation of Package term_arg operand * Defer evaluation of Package term_arg operand
*/ */
@ -741,6 +739,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
break; break;
default: default:
ACPI_ERROR((AE_INFO, "Unknown Integer type 0x%X", ACPI_ERROR((AE_INFO, "Unknown Integer type 0x%X",
op_info->type)); op_info->type));
status = AE_AML_OPERAND_TYPE; status = AE_AML_OPERAND_TYPE;

View File

@ -636,6 +636,7 @@ acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state,
break; break;
default: default:
return_ACPI_STATUS(AE_AML_BAD_OPCODE); return_ACPI_STATUS(AE_AML_BAD_OPCODE);
} }

View File

@ -240,7 +240,6 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
case AML_IF_OP: case AML_IF_OP:
case AML_WHILE_OP: case AML_WHILE_OP:
/* /*
* If we are executing the predicate AND this is the predicate op, * If we are executing the predicate AND this is the predicate op,
* we will use the return value * we will use the return value
@ -254,7 +253,9 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
break; break;
default: default:
/* Ignore other control opcodes */ /* Ignore other control opcodes */
break; break;
} }
@ -263,7 +264,6 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
goto result_not_used; goto result_not_used;
case AML_CLASS_CREATE: case AML_CLASS_CREATE:
/* /*
* These opcodes allow term_arg(s) as operands and therefore * These opcodes allow term_arg(s) as operands and therefore
* the operands can be method calls. The result is used. * the operands can be method calls. The result is used.
@ -292,7 +292,6 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
goto result_not_used; goto result_not_used;
default: default:
/* /*
* In all other cases. the parent will actually use the return * In all other cases. the parent will actually use the return
* object, so keep it. * object, so keep it.

View File

@ -327,6 +327,7 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
break; break;
default: default:
break; break;
} }
@ -488,7 +489,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
break; break;
case AML_TYPE_METHOD_CALL: case AML_TYPE_METHOD_CALL:
/* /*
* If the method is referenced from within a package * If the method is referenced from within a package
* declaration, it is not a invocation of the method, just * declaration, it is not a invocation of the method, just
@ -582,7 +582,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
switch (op->common.parent->common.aml_opcode) { switch (op->common.parent->common.aml_opcode) {
case AML_NAME_OP: case AML_NAME_OP:
/* /*
* Put the Node on the object stack (Contains the ACPI Name * Put the Node on the object stack (Contains the ACPI Name
* of this object) * of this object)

View File

@ -74,6 +74,7 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number)
switch (pass_number) { switch (pass_number) {
case 1: case 1:
walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 | walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 |
ACPI_PARSE_DELETE_TREE; ACPI_PARSE_DELETE_TREE;
walk_state->descending_callback = acpi_ds_load1_begin_op; walk_state->descending_callback = acpi_ds_load1_begin_op;
@ -81,6 +82,7 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number)
break; break;
case 2: case 2:
walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 | walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 |
ACPI_PARSE_DELETE_TREE; ACPI_PARSE_DELETE_TREE;
walk_state->descending_callback = acpi_ds_load2_begin_op; walk_state->descending_callback = acpi_ds_load2_begin_op;
@ -88,6 +90,7 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number)
break; break;
case 3: case 3:
#ifndef ACPI_NO_METHOD_EXECUTION #ifndef ACPI_NO_METHOD_EXECUTION
walk_state->parse_flags |= ACPI_PARSE_EXECUTE | walk_state->parse_flags |= ACPI_PARSE_EXECUTE |
ACPI_PARSE_DELETE_TREE; ACPI_PARSE_DELETE_TREE;
@ -97,6 +100,7 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number)
break; break;
default: default:
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }
@ -161,7 +165,6 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
switch (walk_state->opcode) { switch (walk_state->opcode) {
case AML_SCOPE_OP: case AML_SCOPE_OP:
/* /*
* The target name of the Scope() operator must exist at this point so * The target name of the Scope() operator must exist at this point so
* that we can actually open the scope to enter new names underneath it. * that we can actually open the scope to enter new names underneath it.
@ -210,7 +213,6 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
/* /*
* These types we will allow, but we will change the type. * These types we will allow, but we will change the type.
* This enables some existing code of the form: * This enables some existing code of the form:
@ -232,7 +234,6 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
break; break;
case ACPI_TYPE_METHOD: case ACPI_TYPE_METHOD:
/* /*
* Allow scope change to root during execution of module-level * Allow scope change to root during execution of module-level
* code. Root is typed METHOD during this time. * code. Root is typed METHOD during this time.

View File

@ -509,6 +509,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
break; break;
default: default:
/* All NAMED_FIELD opcodes must be handled above */ /* All NAMED_FIELD opcodes must be handled above */
break; break;
} }
@ -548,6 +549,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
break; break;
default: default:
/* Unknown opcode */ /* Unknown opcode */
status = AE_OK; status = AE_OK;
@ -674,6 +676,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
#endif /* ACPI_NO_METHOD_EXECUTION */ #endif /* ACPI_NO_METHOD_EXECUTION */
default: default:
/* All NAMED_COMPLEX opcodes must be handled above */ /* All NAMED_COMPLEX opcodes must be handled above */
break; break;
} }
@ -721,6 +724,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
break; break;
default: default:
break; break;
} }

View File

@ -529,7 +529,6 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
switch (local_gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) { switch (local_gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) {
case ACPI_GPE_DISPATCH_NOTIFY: case ACPI_GPE_DISPATCH_NOTIFY:
/* /*
* Implicit notify. * Implicit notify.
* Dispatch a DEVICE_WAKE notify to the appropriate handler. * Dispatch a DEVICE_WAKE notify to the appropriate handler.
@ -582,6 +581,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
break; break;
default: default:
return_VOID; /* Should never happen */ return_VOID; /* Should never happen */
} }
@ -754,7 +754,6 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
case ACPI_GPE_DISPATCH_METHOD: case ACPI_GPE_DISPATCH_METHOD:
case ACPI_GPE_DISPATCH_NOTIFY: case ACPI_GPE_DISPATCH_NOTIFY:
/* /*
* Execute the method associated with the GPE * Execute the method associated with the GPE
* NOTE: Level-triggered GPEs are cleared after the method completes. * NOTE: Level-triggered GPEs are cleared after the method completes.
@ -770,7 +769,6 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
break; break;
default: default:
/* /*
* No handler or method to run! * No handler or method to run!
* 03/2010: This case should no longer be possible. We will not allow * 03/2010: This case should no longer be possible. We will not allow

View File

@ -363,14 +363,17 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,
*/ */
switch (name[1]) { switch (name[1]) {
case 'L': case 'L':
type = ACPI_GPE_LEVEL_TRIGGERED; type = ACPI_GPE_LEVEL_TRIGGERED;
break; break;
case 'E': case 'E':
type = ACPI_GPE_EDGE_TRIGGERED; type = ACPI_GPE_EDGE_TRIGGERED;
break; break;
default: default:
/* Unknown method type, just ignore it */ /* Unknown method type, just ignore it */
ACPI_DEBUG_PRINT((ACPI_DB_LOAD, ACPI_DEBUG_PRINT((ACPI_DB_LOAD,

View File

@ -354,36 +354,43 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
switch (space_id) { switch (space_id) {
case ACPI_ADR_SPACE_SYSTEM_MEMORY: case ACPI_ADR_SPACE_SYSTEM_MEMORY:
handler = acpi_ex_system_memory_space_handler; handler = acpi_ex_system_memory_space_handler;
setup = acpi_ev_system_memory_region_setup; setup = acpi_ev_system_memory_region_setup;
break; break;
case ACPI_ADR_SPACE_SYSTEM_IO: case ACPI_ADR_SPACE_SYSTEM_IO:
handler = acpi_ex_system_io_space_handler; handler = acpi_ex_system_io_space_handler;
setup = acpi_ev_io_space_region_setup; setup = acpi_ev_io_space_region_setup;
break; break;
case ACPI_ADR_SPACE_PCI_CONFIG: case ACPI_ADR_SPACE_PCI_CONFIG:
handler = acpi_ex_pci_config_space_handler; handler = acpi_ex_pci_config_space_handler;
setup = acpi_ev_pci_config_region_setup; setup = acpi_ev_pci_config_region_setup;
break; break;
case ACPI_ADR_SPACE_CMOS: case ACPI_ADR_SPACE_CMOS:
handler = acpi_ex_cmos_space_handler; handler = acpi_ex_cmos_space_handler;
setup = acpi_ev_cmos_region_setup; setup = acpi_ev_cmos_region_setup;
break; break;
case ACPI_ADR_SPACE_PCI_BAR_TARGET: case ACPI_ADR_SPACE_PCI_BAR_TARGET:
handler = acpi_ex_pci_bar_space_handler; handler = acpi_ex_pci_bar_space_handler;
setup = acpi_ev_pci_bar_region_setup; setup = acpi_ev_pci_bar_region_setup;
break; break;
case ACPI_ADR_SPACE_DATA_TABLE: case ACPI_ADR_SPACE_DATA_TABLE:
handler = acpi_ex_data_table_space_handler; handler = acpi_ex_data_table_space_handler;
setup = NULL; setup = NULL;
break; break;
default: default:
status = AE_BAD_PARAMETER; status = AE_BAD_PARAMETER;
goto unlock_and_exit; goto unlock_and_exit;
} }

View File

@ -78,6 +78,7 @@ u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node)
return (TRUE); return (TRUE);
default: default:
return (FALSE); return (FALSE);
} }
} }

View File

@ -596,7 +596,9 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
break; break;
default: default:
/* Ignore other objects */ /* Ignore other objects */
break; break;
} }

View File

@ -366,16 +366,19 @@ acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 action)
switch (action) { switch (action) {
case ACPI_GPE_ENABLE: case ACPI_GPE_ENABLE:
ACPI_SET_BIT(gpe_register_info->enable_for_wake, ACPI_SET_BIT(gpe_register_info->enable_for_wake,
(u8)register_bit); (u8)register_bit);
break; break;
case ACPI_GPE_DISABLE: case ACPI_GPE_DISABLE:
ACPI_CLEAR_BIT(gpe_register_info->enable_for_wake, ACPI_CLEAR_BIT(gpe_register_info->enable_for_wake,
(u8)register_bit); (u8)register_bit);
break; break;
default: default:
ACPI_ERROR((AE_INFO, "%u, Invalid action", action)); ACPI_ERROR((AE_INFO, "%u, Invalid action", action));
status = AE_BAD_PARAMETER; status = AE_BAD_PARAMETER;
break; break;

View File

@ -139,6 +139,7 @@ acpi_install_address_space_handler(acpi_handle device,
break; break;
default: default:
break; break;
} }

View File

@ -480,6 +480,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
break; break;
default: default:
return_ACPI_STATUS(AE_AML_OPERAND_TYPE); return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
} }

View File

@ -99,6 +99,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
break; break;
default: default:
return_ACPI_STATUS(AE_TYPE); return_ACPI_STATUS(AE_TYPE);
} }
@ -117,7 +118,6 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
switch (obj_desc->common.type) { switch (obj_desc->common.type) {
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
/* /*
* Convert string to an integer - for most cases, the string must be * Convert string to an integer - for most cases, the string must be
* hexadecimal as per the ACPI specification. The only exception (as * hexadecimal as per the ACPI specification. The only exception (as
@ -161,6 +161,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
default: default:
/* No other types can get here */ /* No other types can get here */
break; break;
} }
@ -213,7 +214,6 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
/* /*
* Create a new Buffer object. * Create a new Buffer object.
* Need enough space for one integer * Need enough space for one integer
@ -233,7 +233,6 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
break; break;
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
/* /*
* Create a new Buffer object * Create a new Buffer object
* Size will be the string length * Size will be the string length
@ -258,6 +257,7 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
break; break;
default: default:
return_ACPI_STATUS(AE_TYPE); return_ACPI_STATUS(AE_TYPE);
} }
@ -304,15 +304,18 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width)
switch (data_width) { switch (data_width) {
case 1: case 1:
decimal_length = ACPI_MAX8_DECIMAL_DIGITS; decimal_length = ACPI_MAX8_DECIMAL_DIGITS;
break; break;
case 4: case 4:
decimal_length = ACPI_MAX32_DECIMAL_DIGITS; decimal_length = ACPI_MAX32_DECIMAL_DIGITS;
break; break;
case 8: case 8:
default: default:
decimal_length = ACPI_MAX64_DECIMAL_DIGITS; decimal_length = ACPI_MAX64_DECIMAL_DIGITS;
break; break;
} }
@ -546,6 +549,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
break; break;
default: default:
return_ACPI_STATUS(AE_TYPE); return_ACPI_STATUS(AE_TYPE);
} }
@ -599,6 +603,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
break; break;
default: default:
/* No conversion allowed for these types */ /* No conversion allowed for these types */
if (destination_type != source_desc->common.type) { if (destination_type != source_desc->common.type) {
@ -649,6 +654,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
break; break;
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Bad destination type during conversion: 0x%X", "Bad destination type during conversion: 0x%X",
destination_type)); destination_type));
@ -664,6 +670,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
break; break;
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Unknown Target type ID 0x%X AmlOpcode 0x%X DestType %s", "Unknown Target type ID 0x%X AmlOpcode 0x%X DestType %s",
GET_CURRENT_ARG_TYPE(walk_state->op_info-> GET_CURRENT_ARG_TYPE(walk_state->op_info->

View File

@ -103,7 +103,6 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
/* /*
* These types open a new scope, so we need the NS node in order to access * These types open a new scope, so we need the NS node in order to access
* any children. * any children.
@ -113,7 +112,6 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)
case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_THERMAL: case ACPI_TYPE_THERMAL:
case ACPI_TYPE_LOCAL_SCOPE: case ACPI_TYPE_LOCAL_SCOPE:
/* /*
* The new alias has the type ALIAS and points to the original * The new alias has the type ALIAS and points to the original
* NS node, not the object itself. * NS node, not the object itself.
@ -124,7 +122,6 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)
break; break;
case ACPI_TYPE_METHOD: case ACPI_TYPE_METHOD:
/* /*
* Control method aliases need to be differentiated * Control method aliases need to be differentiated
*/ */

View File

@ -193,6 +193,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
return_VOID; return_VOID;
default: default:
break; break;
} }
@ -226,6 +227,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
break; break;
default: default:
acpi_ex_do_debug_object((source_desc-> acpi_ex_do_debug_object((source_desc->
reference. reference.
node)->object, node)->object,

View File

@ -357,6 +357,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
switch (info->opcode) { switch (info->opcode) {
case ACPI_EXD_INIT: case ACPI_EXD_INIT:
break; break;
case ACPI_EXD_TYPE: case ACPI_EXD_TYPE:
@ -718,6 +719,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
break; break;
default: default:
/* Unknown Type */ /* Unknown Type */
acpi_os_printf("Unknown Type %X\n", obj_desc->common.type); acpi_os_printf("Unknown Type %X\n", obj_desc->common.type);

View File

@ -331,21 +331,25 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
switch (source_desc->common.type) { switch (source_desc->common.type) {
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
buffer = &source_desc->integer.value; buffer = &source_desc->integer.value;
length = sizeof(source_desc->integer.value); length = sizeof(source_desc->integer.value);
break; break;
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
buffer = source_desc->buffer.pointer; buffer = source_desc->buffer.pointer;
length = source_desc->buffer.length; length = source_desc->buffer.length;
break; break;
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
buffer = source_desc->string.pointer; buffer = source_desc->string.pointer;
length = source_desc->string.length; length = source_desc->string.length;
break; break;
default: default:
return_ACPI_STATUS(AE_AML_OPERAND_TYPE); return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
} }

View File

@ -446,7 +446,6 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc,
break; break;
case ACPI_TYPE_LOCAL_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
/* /*
* Ensure that the bank_value is not beyond the capacity of * Ensure that the bank_value is not beyond the capacity of
* the register * the register
@ -488,7 +487,6 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc,
break; break;
case ACPI_TYPE_LOCAL_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
/* /*
* Ensure that the index_value is not beyond the capacity of * Ensure that the index_value is not beyond the capacity of
* the register * the register

View File

@ -105,7 +105,6 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
break; break;
case ACPI_DESC_TYPE_NAMED: case ACPI_DESC_TYPE_NAMED:
/* /*
* A named reference that has already been resolved to a Node * A named reference that has already been resolved to a Node
*/ */
@ -261,20 +260,24 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
*/ */
switch (operand0->common.type) { switch (operand0->common.type) {
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
status = status =
acpi_ex_convert_to_integer(operand1, &local_operand1, 16); acpi_ex_convert_to_integer(operand1, &local_operand1, 16);
break; break;
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
status = acpi_ex_convert_to_string(operand1, &local_operand1, status = acpi_ex_convert_to_string(operand1, &local_operand1,
ACPI_IMPLICIT_CONVERT_HEX); ACPI_IMPLICIT_CONVERT_HEX);
break; break;
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
status = acpi_ex_convert_to_buffer(operand1, &local_operand1); status = acpi_ex_convert_to_buffer(operand1, &local_operand1);
break; break;
default: default:
ACPI_ERROR((AE_INFO, "Invalid object type: 0x%X", ACPI_ERROR((AE_INFO, "Invalid object type: 0x%X",
operand0->common.type)); operand0->common.type));
status = AE_AML_INTERNAL; status = AE_AML_INTERNAL;
@ -519,6 +522,7 @@ acpi_ex_do_logical_numeric_op(u16 opcode,
break; break;
default: default:
status = AE_AML_INTERNAL; status = AE_AML_INTERNAL;
break; break;
} }
@ -580,20 +584,24 @@ acpi_ex_do_logical_op(u16 opcode,
*/ */
switch (operand0->common.type) { switch (operand0->common.type) {
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
status = status =
acpi_ex_convert_to_integer(operand1, &local_operand1, 16); acpi_ex_convert_to_integer(operand1, &local_operand1, 16);
break; break;
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
status = acpi_ex_convert_to_string(operand1, &local_operand1, status = acpi_ex_convert_to_string(operand1, &local_operand1,
ACPI_IMPLICIT_CONVERT_HEX); ACPI_IMPLICIT_CONVERT_HEX);
break; break;
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
status = acpi_ex_convert_to_buffer(operand1, &local_operand1); status = acpi_ex_convert_to_buffer(operand1, &local_operand1);
break; break;
default: default:
status = AE_AML_INTERNAL; status = AE_AML_INTERNAL;
break; break;
} }
@ -636,6 +644,7 @@ acpi_ex_do_logical_op(u16 opcode,
break; break;
default: default:
status = AE_AML_INTERNAL; status = AE_AML_INTERNAL;
break; break;
} }
@ -703,6 +712,7 @@ acpi_ex_do_logical_op(u16 opcode,
break; break;
default: default:
status = AE_AML_INTERNAL; status = AE_AML_INTERNAL;
break; break;
} }

View File

@ -327,7 +327,6 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
break; break;
case AML_FROM_BCD_OP: /* from_bcd (BCDValue, Result) */ case AML_FROM_BCD_OP: /* from_bcd (BCDValue, Result) */
/* /*
* The 64-bit ACPI integer can hold 16 4-bit BCD characters * The 64-bit ACPI integer can hold 16 4-bit BCD characters
* (if table is 32-bit, integer can hold 8 BCD characters) * (if table is 32-bit, integer can hold 8 BCD characters)
@ -407,7 +406,6 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
break; break;
case AML_COND_REF_OF_OP: /* cond_ref_of (source_object, Result) */ case AML_COND_REF_OF_OP: /* cond_ref_of (source_object, Result) */
/* /*
* This op is a little strange because the internal return value is * This op is a little strange because the internal return value is
* different than the return value stored in the result descriptor * different than the return value stored in the result descriptor
@ -442,13 +440,14 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
goto cleanup; goto cleanup;
default: default:
/* No other opcodes get here */ /* No other opcodes get here */
break; break;
} }
break; break;
case AML_STORE_OP: /* Store (Source, Target) */ case AML_STORE_OP: /* Store (Source, Target) */
/* /*
* A store operand is typically a number, string, buffer or lvalue * A store operand is typically a number, string, buffer or lvalue
* Be careful about deleting the source object, * Be careful about deleting the source object,
@ -615,7 +614,6 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
case AML_DECREMENT_OP: /* Decrement (Operand) */ case AML_DECREMENT_OP: /* Decrement (Operand) */
case AML_INCREMENT_OP: /* Increment (Operand) */ case AML_INCREMENT_OP: /* Increment (Operand) */
/* /*
* Create a new integer. Can't just get the base integer and * Create a new integer. Can't just get the base integer and
* increment it because it may be an Arg or Field. * increment it because it may be an Arg or Field.
@ -682,7 +680,6 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
break; break;
case AML_TYPE_OP: /* object_type (source_object) */ case AML_TYPE_OP: /* object_type (source_object) */
/* /*
* Note: The operand is not resolved at this point because we want to * Note: The operand is not resolved at this point because we want to
* get the associated object, not its value. For example, we don't * get the associated object, not its value. For example, we don't
@ -709,7 +706,6 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
break; break;
case AML_SIZE_OF_OP: /* size_of (source_object) */ case AML_SIZE_OF_OP: /* size_of (source_object) */
/* /*
* Note: The operand is not resolved at this point because we want to * Note: The operand is not resolved at this point because we want to
* get the associated object, not its value. * get the associated object, not its value.
@ -735,10 +731,12 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
*/ */
switch (type) { switch (type) {
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
value = acpi_gbl_integer_byte_width; value = acpi_gbl_integer_byte_width;
break; break;
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
value = temp_desc->string.length; value = temp_desc->string.length;
break; break;
@ -759,6 +757,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
break; break;
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Operand must be Buffer/Integer/String/Package - found type %s", "Operand must be Buffer/Integer/String/Package - found type %s",
acpi_ut_get_type_name(type))); acpi_ut_get_type_name(type)));
@ -860,9 +859,11 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
break; break;
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
break; break;
default: default:
status = AE_AML_OPERAND_TYPE; status = AE_AML_OPERAND_TYPE;
goto cleanup; goto cleanup;
} }
@ -923,7 +924,6 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
*/ */
switch (operand[0]->reference.class) { switch (operand[0]->reference.class) {
case ACPI_REFCLASS_INDEX: case ACPI_REFCLASS_INDEX:
/* /*
* The target type for the Index operator must be * The target type for the Index operator must be
* either a Buffer or a Package * either a Buffer or a Package
@ -956,7 +956,6 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
break; break;
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
/* /*
* Return the referenced element of the package. We must * Return the referenced element of the package. We must
* add another reference to the referenced object, however. * add another reference to the referenced object, however.
@ -999,6 +998,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
break; break;
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Unknown class in reference(%p) - 0x%2.2X", "Unknown class in reference(%p) - 0x%2.2X",
operand[0], operand[0],

View File

@ -304,7 +304,6 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
break; break;
case AML_TO_STRING_OP: /* to_string (Buffer, Length, Result) (ACPI 2.0) */ case AML_TO_STRING_OP: /* to_string (Buffer, Length, Result) (ACPI 2.0) */
/* /*
* Input object is guaranteed to be a buffer at this point (it may have * Input object is guaranteed to be a buffer at this point (it may have
* been converted.) Copy the raw buffer data to a new object of * been converted.) Copy the raw buffer data to a new object of

View File

@ -155,7 +155,6 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
switch (walk_state->opcode) { switch (walk_state->opcode) {
case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */ case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */
/* /*
* Create the return object. The Source operand is guaranteed to be * Create the return object. The Source operand is guaranteed to be
* either a String or a Buffer, so just use its type. * either a String or a Buffer, so just use its type.

View File

@ -119,7 +119,6 @@ acpi_ex_do_match(u32 match_op,
break; break;
case MATCH_MEQ: case MATCH_MEQ:
/* /*
* True if equal: (P[i] == M) * True if equal: (P[i] == M)
* Change to: (M == P[i]) * Change to: (M == P[i])
@ -133,7 +132,6 @@ acpi_ex_do_match(u32 match_op,
break; break;
case MATCH_MLE: case MATCH_MLE:
/* /*
* True if less than or equal: (P[i] <= M) (P[i] not_greater than M) * True if less than or equal: (P[i] <= M) (P[i] not_greater than M)
* Change to: (M >= P[i]) (M not_less than P[i]) * Change to: (M >= P[i]) (M not_less than P[i])
@ -148,7 +146,6 @@ acpi_ex_do_match(u32 match_op,
break; break;
case MATCH_MLT: case MATCH_MLT:
/* /*
* True if less than: (P[i] < M) * True if less than: (P[i] < M)
* Change to: (M > P[i]) * Change to: (M > P[i])
@ -162,7 +159,6 @@ acpi_ex_do_match(u32 match_op,
break; break;
case MATCH_MGE: case MATCH_MGE:
/* /*
* True if greater than or equal: (P[i] >= M) (P[i] not_less than M) * True if greater than or equal: (P[i] >= M) (P[i] not_less than M)
* Change to: (M <= P[i]) (M not_greater than P[i]) * Change to: (M <= P[i]) (M not_greater than P[i])
@ -177,7 +173,6 @@ acpi_ex_do_match(u32 match_op,
break; break;
case MATCH_MGT: case MATCH_MGT:
/* /*
* True if greater than: (P[i] > M) * True if greater than: (P[i] > M)
* Change to: (M < P[i]) * Change to: (M < P[i])

View File

@ -253,26 +253,31 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
case AML_FIELD_ACCESS_BYTE: case AML_FIELD_ACCESS_BYTE:
case AML_FIELD_ACCESS_BUFFER: /* ACPI 2.0 (SMBus Buffer) */ case AML_FIELD_ACCESS_BUFFER: /* ACPI 2.0 (SMBus Buffer) */
byte_alignment = 1; byte_alignment = 1;
bit_length = 8; bit_length = 8;
break; break;
case AML_FIELD_ACCESS_WORD: case AML_FIELD_ACCESS_WORD:
byte_alignment = 2; byte_alignment = 2;
bit_length = 16; bit_length = 16;
break; break;
case AML_FIELD_ACCESS_DWORD: case AML_FIELD_ACCESS_DWORD:
byte_alignment = 4; byte_alignment = 4;
bit_length = 32; bit_length = 32;
break; break;
case AML_FIELD_ACCESS_QWORD: /* ACPI 2.0 */ case AML_FIELD_ACCESS_QWORD: /* ACPI 2.0 */
byte_alignment = 8; byte_alignment = 8;
bit_length = 64; bit_length = 64;
break; break;
default: default:
/* Invalid field access type */ /* Invalid field access type */
ACPI_ERROR((AE_INFO, "Unknown field access type 0x%X", access)); ACPI_ERROR((AE_INFO, "Unknown field access type 0x%X", access));
@ -598,7 +603,9 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
break; break;
default: default:
/* No other types should get here */ /* No other types should get here */
break; break;
} }

View File

@ -88,22 +88,27 @@ acpi_ex_system_memory_space_handler(u32 function,
switch (bit_width) { switch (bit_width) {
case 8: case 8:
length = 1; length = 1;
break; break;
case 16: case 16:
length = 2; length = 2;
break; break;
case 32: case 32:
length = 4; length = 4;
break; break;
case 64: case 64:
length = 8; length = 8;
break; break;
default: default:
ACPI_ERROR((AE_INFO, "Invalid SystemMemory width %u", ACPI_ERROR((AE_INFO, "Invalid SystemMemory width %u",
bit_width)); bit_width));
return_ACPI_STATUS(AE_AML_OPERAND_VALUE); return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
@ -214,23 +219,29 @@ acpi_ex_system_memory_space_handler(u32 function,
*value = 0; *value = 0;
switch (bit_width) { switch (bit_width) {
case 8: case 8:
*value = (u64)ACPI_GET8(logical_addr_ptr); *value = (u64)ACPI_GET8(logical_addr_ptr);
break; break;
case 16: case 16:
*value = (u64)ACPI_GET16(logical_addr_ptr); *value = (u64)ACPI_GET16(logical_addr_ptr);
break; break;
case 32: case 32:
*value = (u64)ACPI_GET32(logical_addr_ptr); *value = (u64)ACPI_GET32(logical_addr_ptr);
break; break;
case 64: case 64:
*value = (u64)ACPI_GET64(logical_addr_ptr); *value = (u64)ACPI_GET64(logical_addr_ptr);
break; break;
default: default:
/* bit_width was already validated */ /* bit_width was already validated */
break; break;
} }
break; break;
@ -239,28 +250,35 @@ acpi_ex_system_memory_space_handler(u32 function,
switch (bit_width) { switch (bit_width) {
case 8: case 8:
ACPI_SET8(logical_addr_ptr, *value); ACPI_SET8(logical_addr_ptr, *value);
break; break;
case 16: case 16:
ACPI_SET16(logical_addr_ptr, *value); ACPI_SET16(logical_addr_ptr, *value);
break; break;
case 32: case 32:
ACPI_SET32(logical_addr_ptr, *value); ACPI_SET32(logical_addr_ptr, *value);
break; break;
case 64: case 64:
ACPI_SET64(logical_addr_ptr, *value); ACPI_SET64(logical_addr_ptr, *value);
break; break;
default: default:
/* bit_width was already validated */ /* bit_width was already validated */
break; break;
} }
break; break;
default: default:
status = AE_BAD_PARAMETER; status = AE_BAD_PARAMETER;
break; break;
} }
@ -320,6 +338,7 @@ acpi_ex_system_io_space_handler(u32 function,
break; break;
default: default:
status = AE_BAD_PARAMETER; status = AE_BAD_PARAMETER;
break; break;
} }

View File

@ -248,6 +248,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
break; break;
default: default:
/* No named references are allowed here */ /* No named references are allowed here */
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,

View File

@ -156,7 +156,6 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
switch (ref_type) { switch (ref_type) {
case ACPI_REFCLASS_LOCAL: case ACPI_REFCLASS_LOCAL:
case ACPI_REFCLASS_ARG: case ACPI_REFCLASS_ARG:
/* /*
* Get the local from the method's state info * Get the local from the method's state info
* Note: this increments the local's object reference count * Note: this increments the local's object reference count
@ -309,6 +308,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
break; break;
default: default:
break; break;
} }
@ -348,10 +348,12 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) { switch (ACPI_GET_DESCRIPTOR_TYPE(obj_desc)) {
case ACPI_DESC_TYPE_OPERAND: case ACPI_DESC_TYPE_OPERAND:
type = obj_desc->common.type; type = obj_desc->common.type;
break; break;
case ACPI_DESC_TYPE_NAMED: case ACPI_DESC_TYPE_NAMED:
type = ((struct acpi_namespace_node *)obj_desc)->type; type = ((struct acpi_namespace_node *)obj_desc)->type;
obj_desc = obj_desc =
acpi_ns_get_attached_object((struct acpi_namespace_node *) acpi_ns_get_attached_object((struct acpi_namespace_node *)
@ -538,7 +540,9 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
break; break;
default: default:
/* No change to Type required */ /* No change to Type required */
break; break;
} }

View File

@ -307,7 +307,6 @@ acpi_ex_resolve_operands(u16 opcode,
case ARGI_TARGETREF: /* Allows implicit conversion rules before store */ case ARGI_TARGETREF: /* Allows implicit conversion rules before store */
case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */ case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */
case ARGI_SIMPLE_TARGET: /* Name, Local, or arg - no implicit conversion */ case ARGI_SIMPLE_TARGET: /* Name, Local, or arg - no implicit conversion */
/* /*
* Need an operand of type ACPI_TYPE_LOCAL_REFERENCE * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE
* A Namespace Node is OK as-is * A Namespace Node is OK as-is
@ -326,7 +325,6 @@ acpi_ex_resolve_operands(u16 opcode,
goto next_operand; goto next_operand;
case ARGI_DATAREFOBJ: /* Store operator only */ case ARGI_DATAREFOBJ: /* Store operator only */
/* /*
* We don't want to resolve index_op reference objects during * We don't want to resolve index_op reference objects during
* a store because this would be an implicit de_ref_of operation. * a store because this would be an implicit de_ref_of operation.
@ -343,7 +341,9 @@ acpi_ex_resolve_operands(u16 opcode,
break; break;
default: default:
/* All cases covered above */ /* All cases covered above */
break; break;
} }
@ -433,7 +433,6 @@ acpi_ex_resolve_operands(u16 opcode,
goto next_operand; goto next_operand;
case ARGI_BUFFER: case ARGI_BUFFER:
/* /*
* Need an operand of type ACPI_TYPE_BUFFER, * Need an operand of type ACPI_TYPE_BUFFER,
* But we can implicitly convert from a STRING or INTEGER * But we can implicitly convert from a STRING or INTEGER
@ -459,7 +458,6 @@ acpi_ex_resolve_operands(u16 opcode,
goto next_operand; goto next_operand;
case ARGI_STRING: case ARGI_STRING:
/* /*
* Need an operand of type ACPI_TYPE_STRING, * Need an operand of type ACPI_TYPE_STRING,
* But we can implicitly convert from a BUFFER or INTEGER * But we can implicitly convert from a BUFFER or INTEGER
@ -562,6 +560,7 @@ acpi_ex_resolve_operands(u16 opcode,
break; break;
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Needed [Buffer/String/Package/Reference], found [%s] %p", "Needed [Buffer/String/Package/Reference], found [%s] %p",
acpi_ut_get_object_type_name acpi_ut_get_object_type_name
@ -584,6 +583,7 @@ acpi_ex_resolve_operands(u16 opcode,
break; break;
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Needed [Buffer/String/Package], found [%s] %p", "Needed [Buffer/String/Package], found [%s] %p",
acpi_ut_get_object_type_name acpi_ut_get_object_type_name
@ -605,6 +605,7 @@ acpi_ex_resolve_operands(u16 opcode,
break; break;
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Needed [Region/Buffer], found [%s] %p", "Needed [Region/Buffer], found [%s] %p",
acpi_ut_get_object_type_name acpi_ut_get_object_type_name

View File

@ -114,6 +114,7 @@ acpi_ex_store(union acpi_operand_object *source_desc,
switch (dest_desc->common.type) { switch (dest_desc->common.type) {
case ACPI_TYPE_LOCAL_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
break; break;
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
@ -178,7 +179,6 @@ acpi_ex_store(union acpi_operand_object *source_desc,
break; break;
case ACPI_REFCLASS_DEBUG: case ACPI_REFCLASS_DEBUG:
/* /*
* Storing to the Debug object causes the value stored to be * Storing to the Debug object causes the value stored to be
* displayed and otherwise has no effect -- see ACPI Specification * displayed and otherwise has no effect -- see ACPI Specification
@ -291,7 +291,6 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
break; break;
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
/* /*
* Store into a Buffer or String (not actually a real buffer_field) * Store into a Buffer or String (not actually a real buffer_field)
* at a location defined by an Index. * at a location defined by an Index.
@ -447,7 +446,6 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
/* /*
* These target types are all of type Integer/String/Buffer, and * These target types are all of type Integer/String/Buffer, and
* therefore support implicit conversion before the store. * therefore support implicit conversion before the store.

View File

@ -85,11 +85,9 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
* These cases all require only Integers or values that * These cases all require only Integers or values that
* can be converted to Integers (Strings or Buffers) * can be converted to Integers (Strings or Buffers)
*/ */
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
/* /*
* Stores into a Field/Region or into a Integer/Buffer/String * Stores into a Field/Region or into a Integer/Buffer/String
* are all essentially the same. This case handles the * are all essentially the same. This case handles the
@ -133,7 +131,6 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
case ACPI_TYPE_LOCAL_ALIAS: case ACPI_TYPE_LOCAL_ALIAS:
case ACPI_TYPE_LOCAL_METHOD_ALIAS: case ACPI_TYPE_LOCAL_METHOD_ALIAS:
/* /*
* All aliases should have been resolved earlier, during the * All aliases should have been resolved earlier, during the
* operand resolution phase. * operand resolution phase.
@ -144,7 +141,6 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
default: default:
/* /*
* All other types than Alias and the various Fields come here, * All other types than Alias and the various Fields come here,
* including the untyped case - ACPI_TYPE_ANY. * including the untyped case - ACPI_TYPE_ANY.

View File

@ -108,7 +108,6 @@ acpi_status acpi_hw_set_mode(u32 mode)
break; break;
case ACPI_SYS_MODE_LEGACY: case ACPI_SYS_MODE_LEGACY:
/* /*
* BIOS should clear all fixed status bits and restore fixed event * BIOS should clear all fixed status bits and restore fixed event
* enable bits to default * enable bits to default
@ -120,6 +119,7 @@ acpi_status acpi_hw_set_mode(u32 mode)
break; break;
default: default:
return_ACPI_STATUS(AE_BAD_PARAMETER); return_ACPI_STATUS(AE_BAD_PARAMETER);
} }

View File

@ -127,14 +127,17 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action)
/*lint -fallthrough */ /*lint -fallthrough */
case ACPI_GPE_ENABLE: case ACPI_GPE_ENABLE:
ACPI_SET_BIT(enable_mask, register_bit); ACPI_SET_BIT(enable_mask, register_bit);
break; break;
case ACPI_GPE_DISABLE: case ACPI_GPE_DISABLE:
ACPI_CLEAR_BIT(enable_mask, register_bit); ACPI_CLEAR_BIT(enable_mask, register_bit);
break; break;
default: default:
ACPI_ERROR((AE_INFO, "Invalid GPE Action, %u", action)); ACPI_ERROR((AE_INFO, "Invalid GPE Action, %u", action));
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }

View File

@ -419,6 +419,7 @@ acpi_status acpi_hw_register_read(u32 register_id, u32 *return_value)
break; break;
default: default:
ACPI_ERROR((AE_INFO, "Unknown Register ID: 0x%X", register_id)); ACPI_ERROR((AE_INFO, "Unknown Register ID: 0x%X", register_id));
status = AE_BAD_PARAMETER; status = AE_BAD_PARAMETER;
break; break;
@ -491,7 +492,6 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
break; break;
case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */ case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
/* /*
* Perform a read first to preserve certain bits (per ACPI spec) * Perform a read first to preserve certain bits (per ACPI spec)
* Note: This includes SCI_EN, we never want to change this bit * Note: This includes SCI_EN, we never want to change this bit
@ -520,7 +520,6 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
break; break;
case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
/* /*
* For control registers, all reserved bits must be preserved, * For control registers, all reserved bits must be preserved,
* as per the ACPI spec. * as per the ACPI spec.
@ -555,6 +554,7 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
break; break;
default: default:
ACPI_ERROR((AE_INFO, "Unknown Register ID: 0x%X", register_id)); ACPI_ERROR((AE_INFO, "Unknown Register ID: 0x%X", register_id));
status = AE_BAD_PARAMETER; status = AE_BAD_PARAMETER;
break; break;

View File

@ -528,10 +528,12 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
elements = info->return_object->package.elements; elements = info->return_object->package.elements;
switch (info->return_object->package.count) { switch (info->return_object->package.count) {
case 0: case 0:
status = AE_AML_PACKAGE_LIMIT; status = AE_AML_PACKAGE_LIMIT;
break; break;
case 1: case 1:
if (elements[0]->common.type != ACPI_TYPE_INTEGER) { if (elements[0]->common.type != ACPI_TYPE_INTEGER) {
status = AE_AML_OPERAND_TYPE; status = AE_AML_OPERAND_TYPE;
break; break;
@ -545,6 +547,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
case 2: case 2:
default: default:
if ((elements[0]->common.type != ACPI_TYPE_INTEGER) || if ((elements[0]->common.type != ACPI_TYPE_INTEGER) ||
(elements[1]->common.type != ACPI_TYPE_INTEGER)) { (elements[1]->common.type != ACPI_TYPE_INTEGER)) {
status = AE_AML_OPERAND_TYPE; status = AE_AML_OPERAND_TYPE;

View File

@ -314,20 +314,24 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state)
switch (sleep_state) { switch (sleep_state) {
case ACPI_STATE_S0: case ACPI_STATE_S0:
sst_value = ACPI_SST_WORKING; sst_value = ACPI_SST_WORKING;
break; break;
case ACPI_STATE_S1: case ACPI_STATE_S1:
case ACPI_STATE_S2: case ACPI_STATE_S2:
case ACPI_STATE_S3: case ACPI_STATE_S3:
sst_value = ACPI_SST_SLEEPING; sst_value = ACPI_SST_SLEEPING;
break; break;
case ACPI_STATE_S4: case ACPI_STATE_S4:
sst_value = ACPI_SST_SLEEP_CONTEXT; sst_value = ACPI_SST_SLEEP_CONTEXT;
break; break;
default: default:
sst_value = ACPI_SST_INDICATOR_OFF; /* Default is off */ sst_value = ACPI_SST_INDICATOR_OFF; /* Default is off */
break; break;
} }

View File

@ -151,6 +151,7 @@ acpi_status acpi_ns_root_initialize(void)
*/ */
switch (init_val->type) { switch (init_val->type) {
case ACPI_TYPE_METHOD: case ACPI_TYPE_METHOD:
obj_desc->method.param_count = obj_desc->method.param_count =
(u8) ACPI_TO_INTEGER(val); (u8) ACPI_TO_INTEGER(val);
obj_desc->common.flags |= AOPOBJ_DATA_VALID; obj_desc->common.flags |= AOPOBJ_DATA_VALID;

View File

@ -103,6 +103,7 @@ acpi_ns_convert_to_integer(union acpi_operand_object *original_object,
break; break;
default: default:
return (AE_AML_OPERAND_TYPE); return (AE_AML_OPERAND_TYPE);
} }
@ -191,6 +192,7 @@ acpi_ns_convert_to_string(union acpi_operand_object *original_object,
break; break;
default: default:
return (AE_AML_OPERAND_TYPE); return (AE_AML_OPERAND_TYPE);
} }
@ -294,6 +296,7 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
break; break;
default: default:
return (AE_AML_OPERAND_TYPE); return (AE_AML_OPERAND_TYPE);
} }

View File

@ -244,10 +244,12 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
case ACPI_TYPE_METHOD: case ACPI_TYPE_METHOD:
acpi_os_printf("<No attached object>"); acpi_os_printf("<No attached object>");
break; break;
default: default:
break; break;
} }
@ -433,6 +435,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
break; break;
default: default:
break; break;
} }
break; break;
@ -567,32 +570,39 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
goto cleanup; goto cleanup;
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
obj_desc = obj_desc =
(union acpi_operand_object *)obj_desc->buffer_field. (union acpi_operand_object *)obj_desc->buffer_field.
buffer_obj; buffer_obj;
break; break;
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
obj_desc = (void *)obj_desc->package.elements; obj_desc = (void *)obj_desc->package.elements;
break; break;
case ACPI_TYPE_METHOD: case ACPI_TYPE_METHOD:
obj_desc = (void *)obj_desc->method.aml_start; obj_desc = (void *)obj_desc->method.aml_start;
break; break;
case ACPI_TYPE_LOCAL_REGION_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD:
obj_desc = (void *)obj_desc->field.region_obj; obj_desc = (void *)obj_desc->field.region_obj;
break; break;
case ACPI_TYPE_LOCAL_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
obj_desc = (void *)obj_desc->bank_field.region_obj; obj_desc = (void *)obj_desc->bank_field.region_obj;
break; break;
case ACPI_TYPE_LOCAL_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
obj_desc = (void *)obj_desc->index_field.index_obj; obj_desc = (void *)obj_desc->index_field.index_obj;
break; break;
default: default:
goto cleanup; goto cleanup;
} }

View File

@ -266,28 +266,34 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
switch (type) { switch (type) {
case ACPI_TYPE_REGION: case ACPI_TYPE_REGION:
info->op_region_count++; info->op_region_count++;
break; break;
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
info->field_count++; info->field_count++;
break; break;
case ACPI_TYPE_LOCAL_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
info->field_count++; info->field_count++;
break; break;
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
info->buffer_count++; info->buffer_count++;
break; break;
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
info->package_count++; info->package_count++;
break; break;
default: default:
/* No init required, just exit now */ /* No init required, just exit now */
return (AE_OK); return (AE_OK);
} }
@ -337,7 +343,9 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
break; break;
default: default:
/* No other types can get here */ /* No other types can get here */
break; break;
} }
@ -416,6 +424,7 @@ acpi_ns_find_ini_methods(acpi_handle obj_handle,
break; break;
default: default:
break; break;
} }

View File

@ -344,26 +344,32 @@ static u32 acpi_ns_get_bitmapped_type(union acpi_operand_object *return_object)
switch (return_object->common.type) { switch (return_object->common.type) {
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
return_btype = ACPI_RTYPE_INTEGER; return_btype = ACPI_RTYPE_INTEGER;
break; break;
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
return_btype = ACPI_RTYPE_BUFFER; return_btype = ACPI_RTYPE_BUFFER;
break; break;
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
return_btype = ACPI_RTYPE_STRING; return_btype = ACPI_RTYPE_STRING;
break; break;
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
return_btype = ACPI_RTYPE_PACKAGE; return_btype = ACPI_RTYPE_PACKAGE;
break; break;
case ACPI_TYPE_LOCAL_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
return_btype = ACPI_RTYPE_REFERENCE; return_btype = ACPI_RTYPE_REFERENCE;
break; break;
default: default:
/* Not one of the supported objects, must be incorrect */ /* Not one of the supported objects, must be incorrect */
return_btype = ACPI_RTYPE_ANY; return_btype = ACPI_RTYPE_ANY;

View File

@ -136,7 +136,6 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
*/ */
switch (package->ret_info.type) { switch (package->ret_info.type) {
case ACPI_PTYPE1_FIXED: case ACPI_PTYPE1_FIXED:
/* /*
* The package count is fixed and there are no sub-packages * The package count is fixed and there are no sub-packages
* *
@ -169,7 +168,6 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
break; break;
case ACPI_PTYPE1_VAR: case ACPI_PTYPE1_VAR:
/* /*
* The package count is variable, there are no sub-packages, and all * The package count is variable, there are no sub-packages, and all
* elements must be of the same type * elements must be of the same type
@ -186,7 +184,6 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
break; break;
case ACPI_PTYPE1_OPTION: case ACPI_PTYPE1_OPTION:
/* /*
* The package count is variable, there are no sub-packages. There are * The package count is variable, there are no sub-packages. There are
* a fixed number of required elements, and a variable number of * a fixed number of required elements, and a variable number of
@ -284,7 +281,6 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
case ACPI_PTYPE2_MIN: case ACPI_PTYPE2_MIN:
case ACPI_PTYPE2_COUNT: case ACPI_PTYPE2_COUNT:
case ACPI_PTYPE2_FIX_VAR: case ACPI_PTYPE2_FIX_VAR:
/* /*
* These types all return a single Package that consists of a * These types all return a single Package that consists of a
* variable number of sub-Packages. * variable number of sub-Packages.
@ -500,7 +496,6 @@ acpi_ns_check_package_list(struct acpi_evaluate_info *info,
break; break;
case ACPI_PTYPE2_COUNT: case ACPI_PTYPE2_COUNT:
/* /*
* First element is the (Integer) count of elements, including * First element is the (Integer) count of elements, including
* the count field (the ACPI name is num_elements) * the count field (the ACPI name is num_elements)

View File

@ -480,6 +480,7 @@ acpi_ns_remove_null_elements(struct acpi_evaluate_info *info,
case ACPI_PTYPE2_MIN: case ACPI_PTYPE2_MIN:
case ACPI_PTYPE2_REV_FIXED: case ACPI_PTYPE2_REV_FIXED:
case ACPI_PTYPE2_FIX_VAR: case ACPI_PTYPE2_FIX_VAR:
break; break;
default: default:

View File

@ -320,6 +320,7 @@ acpi_ns_repair_FDE(struct acpi_evaluate_info *info,
break; break;
default: default:
return (AE_AML_OPERAND_TYPE); return (AE_AML_OPERAND_TYPE);
} }

View File

@ -419,10 +419,12 @@ acpi_ns_externalize_name(u32 internal_name_length,
switch (internal_name[0]) { switch (internal_name[0]) {
case AML_ROOT_PREFIX: case AML_ROOT_PREFIX:
prefix_length = 1; prefix_length = 1;
break; break;
case AML_PARENT_PREFIX: case AML_PARENT_PREFIX:
for (i = 0; i < internal_name_length; i++) { for (i = 0; i < internal_name_length; i++) {
if (ACPI_IS_PARENT_PREFIX(internal_name[i])) { if (ACPI_IS_PARENT_PREFIX(internal_name[i])) {
prefix_length = i + 1; prefix_length = i + 1;
@ -438,6 +440,7 @@ acpi_ns_externalize_name(u32 internal_name_length,
break; break;
default: default:
break; break;
} }

View File

@ -511,6 +511,7 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info)
break; break;
default: default:
return; return;
} }

View File

@ -629,24 +629,28 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
switch (opcode) { switch (opcode) {
case AML_BYTE_OP: /* AML_BYTEDATA_ARG */ case AML_BYTE_OP: /* AML_BYTEDATA_ARG */
buffer_length = buffer_length =
ACPI_GET8(parser_state->aml); ACPI_GET8(parser_state->aml);
parser_state->aml += 1; parser_state->aml += 1;
break; break;
case AML_WORD_OP: /* AML_WORDDATA_ARG */ case AML_WORD_OP: /* AML_WORDDATA_ARG */
buffer_length = buffer_length =
ACPI_GET16(parser_state->aml); ACPI_GET16(parser_state->aml);
parser_state->aml += 2; parser_state->aml += 2;
break; break;
case AML_DWORD_OP: /* AML_DWORDATA_ARG */ case AML_DWORD_OP: /* AML_DWORDATA_ARG */
buffer_length = buffer_length =
ACPI_GET32(parser_state->aml); ACPI_GET32(parser_state->aml);
parser_state->aml += 4; parser_state->aml += 4;
break; break;
default: default:
buffer_length = 0; buffer_length = 0;
break; break;
} }

View File

@ -164,7 +164,6 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
case AML_IF_OP: case AML_IF_OP:
case AML_ELSE_OP: case AML_ELSE_OP:
case AML_WHILE_OP: case AML_WHILE_OP:
/* /*
* Currently supported module-level opcodes are: * Currently supported module-level opcodes are:
* IF/ELSE/WHILE. These appear to be the most common, * IF/ELSE/WHILE. These appear to be the most common,
@ -289,6 +288,7 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
default: default:
/* No action for all other opcodes */ /* No action for all other opcodes */
break; break;
} }

View File

@ -402,6 +402,7 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state,
switch (status) { switch (status) {
case AE_OK: case AE_OK:
break; break;
case AE_CTRL_TRANSFER: case AE_CTRL_TRANSFER:

View File

@ -176,10 +176,10 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
switch (parent_info->class) { switch (parent_info->class) {
case AML_CLASS_CONTROL: case AML_CLASS_CONTROL:
break; break;
case AML_CLASS_CREATE: case AML_CLASS_CREATE:
/* /*
* These opcodes contain term_arg operands. The current * These opcodes contain term_arg operands. The current
* op must be replaced by a placeholder return op * op must be replaced by a placeholder return op
@ -192,7 +192,6 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
break; break;
case AML_CLASS_NAMED_OBJECT: case AML_CLASS_NAMED_OBJECT:
/* /*
* These opcodes contain term_arg operands. The current * These opcodes contain term_arg operands. The current
* op must be replaced by a placeholder return op * op must be replaced by a placeholder return op

View File

@ -308,7 +308,9 @@ union acpi_parse_object *acpi_ps_get_child(union acpi_parse_object *op)
break; break;
default: default:
/* All others have no children */ /* All others have no children */
break; break;
} }

View File

@ -352,6 +352,7 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
break; break;
default: default:
break; break;
} }
@ -539,6 +540,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
break; break;
default: default:
break; break;
} }

View File

@ -120,17 +120,20 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
/* Strings */ /* Strings */
case ACPI_RSD_LITERAL: case ACPI_RSD_LITERAL:
acpi_rs_out_string(name, acpi_rs_out_string(name,
ACPI_CAST_PTR(char, table->pointer)); ACPI_CAST_PTR(char, table->pointer));
break; break;
case ACPI_RSD_STRING: case ACPI_RSD_STRING:
acpi_rs_out_string(name, ACPI_CAST_PTR(char, target)); acpi_rs_out_string(name, ACPI_CAST_PTR(char, target));
break; break;
/* Data items, 8/16/32/64 bit */ /* Data items, 8/16/32/64 bit */
case ACPI_RSD_UINT8: case ACPI_RSD_UINT8:
if (table->pointer) { if (table->pointer) {
acpi_rs_out_string(name, ACPI_CAST_PTR(char, acpi_rs_out_string(name, ACPI_CAST_PTR(char,
table-> table->
@ -142,20 +145,24 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
break; break;
case ACPI_RSD_UINT16: case ACPI_RSD_UINT16:
acpi_rs_out_integer16(name, ACPI_GET16(target)); acpi_rs_out_integer16(name, ACPI_GET16(target));
break; break;
case ACPI_RSD_UINT32: case ACPI_RSD_UINT32:
acpi_rs_out_integer32(name, ACPI_GET32(target)); acpi_rs_out_integer32(name, ACPI_GET32(target));
break; break;
case ACPI_RSD_UINT64: case ACPI_RSD_UINT64:
acpi_rs_out_integer64(name, ACPI_GET64(target)); acpi_rs_out_integer64(name, ACPI_GET64(target));
break; break;
/* Flags: 1-bit and 2-bit flags supported */ /* Flags: 1-bit and 2-bit flags supported */
case ACPI_RSD_1BITFLAG: case ACPI_RSD_1BITFLAG:
acpi_rs_out_string(name, ACPI_CAST_PTR(char, acpi_rs_out_string(name, ACPI_CAST_PTR(char,
table-> table->
pointer[*target & pointer[*target &
@ -163,6 +170,7 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
break; break;
case ACPI_RSD_2BITFLAG: case ACPI_RSD_2BITFLAG:
acpi_rs_out_string(name, ACPI_CAST_PTR(char, acpi_rs_out_string(name, ACPI_CAST_PTR(char,
table-> table->
pointer[*target & pointer[*target &
@ -170,6 +178,7 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
break; break;
case ACPI_RSD_3BITFLAG: case ACPI_RSD_3BITFLAG:
acpi_rs_out_string(name, ACPI_CAST_PTR(char, acpi_rs_out_string(name, ACPI_CAST_PTR(char,
table-> table->
pointer[*target & pointer[*target &
@ -258,6 +267,7 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
break; break;
default: default:
acpi_os_printf("**** Invalid table opcode [%X] ****\n", acpi_os_printf("**** Invalid table opcode [%X] ****\n",
table->opcode); table->opcode);
return; return;

View File

@ -194,7 +194,6 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
break; break;
case ACPI_RSC_COUNT_GPIO_RES: case ACPI_RSC_COUNT_GPIO_RES:
/* /*
* Vendor data is optional (length/offset may both be zero) * Vendor data is optional (length/offset may both be zero)
* Examine vendor data length field first * Examine vendor data length field first
@ -410,12 +409,14 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
*/ */
switch (info->resource_offset) { switch (info->resource_offset) {
case ACPI_RSC_COMPARE_AML_LENGTH: case ACPI_RSC_COMPARE_AML_LENGTH:
if (aml_resource_length != info->value) { if (aml_resource_length != info->value) {
goto exit; goto exit;
} }
break; break;
case ACPI_RSC_COMPARE_VALUE: case ACPI_RSC_COMPARE_VALUE:
if (ACPI_GET8(source) != info->value) { if (ACPI_GET8(source) != info->value) {
goto exit; goto exit;
} }

View File

@ -147,6 +147,7 @@ acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type)
case ACPI_RSC_MOVE_GPIO_RES: case ACPI_RSC_MOVE_GPIO_RES:
case ACPI_RSC_MOVE_SERIAL_VEN: case ACPI_RSC_MOVE_SERIAL_VEN:
case ACPI_RSC_MOVE_SERIAL_RES: case ACPI_RSC_MOVE_SERIAL_RES:
ACPI_MEMCPY(destination, source, item_count); ACPI_MEMCPY(destination, source, item_count);
return; return;
@ -157,21 +158,25 @@ acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type)
*/ */
case ACPI_RSC_MOVE16: case ACPI_RSC_MOVE16:
case ACPI_RSC_MOVE_GPIO_PIN: case ACPI_RSC_MOVE_GPIO_PIN:
ACPI_MOVE_16_TO_16(&ACPI_CAST_PTR(u16, destination)[i], ACPI_MOVE_16_TO_16(&ACPI_CAST_PTR(u16, destination)[i],
&ACPI_CAST_PTR(u16, source)[i]); &ACPI_CAST_PTR(u16, source)[i]);
break; break;
case ACPI_RSC_MOVE32: case ACPI_RSC_MOVE32:
ACPI_MOVE_32_TO_32(&ACPI_CAST_PTR(u32, destination)[i], ACPI_MOVE_32_TO_32(&ACPI_CAST_PTR(u32, destination)[i],
&ACPI_CAST_PTR(u32, source)[i]); &ACPI_CAST_PTR(u32, source)[i]);
break; break;
case ACPI_RSC_MOVE64: case ACPI_RSC_MOVE64:
ACPI_MOVE_64_TO_64(&ACPI_CAST_PTR(u64, destination)[i], ACPI_MOVE_64_TO_64(&ACPI_CAST_PTR(u64, destination)[i],
&ACPI_CAST_PTR(u64, source)[i]); &ACPI_CAST_PTR(u64, source)[i]);
break; break;
default: default:
return; return;
} }
} }

View File

@ -402,6 +402,7 @@ acpi_resource_to_address64(struct acpi_resource *resource,
break; break;
default: default:
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }

View File

@ -471,15 +471,19 @@ void acpi_tb_delete_table(struct acpi_table_desc *table_desc)
} }
switch (table_desc->flags & ACPI_TABLE_ORIGIN_MASK) { switch (table_desc->flags & ACPI_TABLE_ORIGIN_MASK) {
case ACPI_TABLE_ORIGIN_MAPPED: case ACPI_TABLE_ORIGIN_MAPPED:
acpi_os_unmap_memory(table_desc->pointer, table_desc->length); acpi_os_unmap_memory(table_desc->pointer, table_desc->length);
break; break;
case ACPI_TABLE_ORIGIN_ALLOCATED: case ACPI_TABLE_ORIGIN_ALLOCATED:
ACPI_FREE(table_desc->pointer); ACPI_FREE(table_desc->pointer);
break; break;
/* Not mapped or allocated, there is nothing we can do */ /* Not mapped or allocated, there is nothing we can do */
default: default:
return; return;
} }

View File

@ -178,7 +178,6 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object,
switch (internal_object->reference.class) { switch (internal_object->reference.class) {
case ACPI_REFCLASS_NAME: case ACPI_REFCLASS_NAME:
/* /*
* For namepath, return the object handle ("reference") * For namepath, return the object handle ("reference")
* We are referring to the namespace node * We are referring to the namespace node
@ -264,7 +263,6 @@ acpi_ut_copy_ielement_to_eelement(u8 object_type,
switch (object_type) { switch (object_type) {
case ACPI_COPY_TYPE_SIMPLE: case ACPI_COPY_TYPE_SIMPLE:
/* /*
* This is a simple or null object * This is a simple or null object
*/ */
@ -278,7 +276,6 @@ acpi_ut_copy_ielement_to_eelement(u8 object_type,
break; break;
case ACPI_COPY_TYPE_PACKAGE: case ACPI_COPY_TYPE_PACKAGE:
/* /*
* Build the package object * Build the package object
*/ */
@ -304,6 +301,7 @@ acpi_ut_copy_ielement_to_eelement(u8 object_type,
break; break;
default: default:
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }
@ -481,6 +479,7 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
default: default:
/* All other types are not supported */ /* All other types are not supported */
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
@ -544,7 +543,9 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
break; break;
default: default:
/* Other types can't get here */ /* Other types can't get here */
break; break;
} }
@ -800,7 +801,9 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
break; break;
default: default:
/* Nothing to do for other simple objects */ /* Nothing to do for other simple objects */
break; break;
} }
@ -868,7 +871,6 @@ acpi_ut_copy_ielement_to_ielement(u8 object_type,
break; break;
case ACPI_COPY_TYPE_PACKAGE: case ACPI_COPY_TYPE_PACKAGE:
/* /*
* This object is a package - go down another nesting level * This object is a package - go down another nesting level
* Create and build the package object * Create and build the package object
@ -891,6 +893,7 @@ acpi_ut_copy_ielement_to_ielement(u8 object_type,
break; break;
default: default:
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }

View File

@ -303,6 +303,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
break; break;
default: default:
break; break;
} }
@ -508,7 +509,6 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_POWER: case ACPI_TYPE_POWER:
case ACPI_TYPE_THERMAL: case ACPI_TYPE_THERMAL:
/* /*
* Update the notify objects for these types (if present) * Update the notify objects for these types (if present)
* Two lists, system and device notify handlers. * Two lists, system and device notify handlers.
@ -623,6 +623,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
case ACPI_TYPE_REGION: case ACPI_TYPE_REGION:
default: default:
break; /* No subobjects for all other types */ break; /* No subobjects for all other types */
} }

View File

@ -123,22 +123,27 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
switch ((info->return_object)->common.type) { switch ((info->return_object)->common.type) {
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
return_btype = ACPI_BTYPE_INTEGER; return_btype = ACPI_BTYPE_INTEGER;
break; break;
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
return_btype = ACPI_BTYPE_BUFFER; return_btype = ACPI_BTYPE_BUFFER;
break; break;
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
return_btype = ACPI_BTYPE_STRING; return_btype = ACPI_BTYPE_STRING;
break; break;
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
return_btype = ACPI_BTYPE_PACKAGE; return_btype = ACPI_BTYPE_PACKAGE;
break; break;
default: default:
return_btype = 0; return_btype = 0;
break; break;
} }

View File

@ -146,6 +146,7 @@ const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status status)
break; break;
default: default:
break; break;
} }

View File

@ -341,14 +341,17 @@ acpi_ut_execute_CID(struct acpi_namespace_node *device_node,
switch (cid_objects[i]->common.type) { switch (cid_objects[i]->common.type) {
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
string_area_size += ACPI_EISAID_STRING_SIZE; string_area_size += ACPI_EISAID_STRING_SIZE;
break; break;
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
string_area_size += cid_objects[i]->string.length + 1; string_area_size += cid_objects[i]->string.length + 1;
break; break;
default: default:
status = AE_TYPE; status = AE_TYPE;
goto cleanup; goto cleanup;
} }

View File

@ -382,10 +382,12 @@ acpi_ut_display_init_pathname(u8 type,
switch (type) { switch (type) {
case ACPI_TYPE_METHOD: case ACPI_TYPE_METHOD:
acpi_os_printf("Executing "); acpi_os_printf("Executing ");
break; break;
default: default:
acpi_os_printf("Initializing "); acpi_os_printf("Initializing ");
break; break;
} }

View File

@ -129,6 +129,7 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char
break; break;
default: default:
/* All others have no secondary object */ /* All others have no secondary object */
break; break;
} }
@ -353,6 +354,7 @@ u8 acpi_ut_valid_internal_object(void *object)
return (TRUE); return (TRUE);
default: default:
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"%p is not not an ACPI operand obj [%s]\n", "%p is not not an ACPI operand obj [%s]\n",
object, acpi_ut_get_descriptor_name(object))); object, acpi_ut_get_descriptor_name(object)));
@ -509,7 +511,6 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
switch (internal_object->reference.class) { switch (internal_object->reference.class) {
case ACPI_REFCLASS_NAME: case ACPI_REFCLASS_NAME:
/* /*
* Get the actual length of the full pathname to this object. * Get the actual length of the full pathname to this object.
* The reference will be converted to the pathname to the object * The reference will be converted to the pathname to the object
@ -525,7 +526,6 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
break; break;
default: default:
/* /*
* No other reference opcodes are supported. * No other reference opcodes are supported.
* Notably, Locals and Args are not supported, but this may be * Notably, Locals and Args are not supported, but this may be
@ -585,7 +585,6 @@ acpi_ut_get_element_length(u8 object_type,
switch (object_type) { switch (object_type) {
case ACPI_COPY_TYPE_SIMPLE: case ACPI_COPY_TYPE_SIMPLE:
/* /*
* Simple object - just get the size (Null object/entry is handled * Simple object - just get the size (Null object/entry is handled
* here also) and sum it into the running package length * here also) and sum it into the running package length

View File

@ -186,10 +186,13 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer)
switch (base) { switch (base) {
case ACPI_ANY_BASE: case ACPI_ANY_BASE:
case 16: case 16:
break; break;
default: default:
/* Invalid Base */ /* Invalid Base */
return_ACPI_STATUS(AE_BAD_PARAMETER); return_ACPI_STATUS(AE_BAD_PARAMETER);
} }
@ -355,36 +358,44 @@ void acpi_ut_print_string(char *string, u8 max_length)
switch (string[i]) { switch (string[i]) {
case 0x07: case 0x07:
acpi_os_printf("\\a"); /* BELL */ acpi_os_printf("\\a"); /* BELL */
break; break;
case 0x08: case 0x08:
acpi_os_printf("\\b"); /* BACKSPACE */ acpi_os_printf("\\b"); /* BACKSPACE */
break; break;
case 0x0C: case 0x0C:
acpi_os_printf("\\f"); /* FORMFEED */ acpi_os_printf("\\f"); /* FORMFEED */
break; break;
case 0x0A: case 0x0A:
acpi_os_printf("\\n"); /* LINEFEED */ acpi_os_printf("\\n"); /* LINEFEED */
break; break;
case 0x0D: case 0x0D:
acpi_os_printf("\\r"); /* CARRIAGE RETURN */ acpi_os_printf("\\r"); /* CARRIAGE RETURN */
break; break;
case 0x09: case 0x09:
acpi_os_printf("\\t"); /* HORIZONTAL TAB */ acpi_os_printf("\\t"); /* HORIZONTAL TAB */
break; break;
case 0x0B: case 0x0B:
acpi_os_printf("\\v"); /* VERTICAL TAB */ acpi_os_printf("\\v"); /* VERTICAL TAB */
break; break;
case '\'': /* Single Quote */ case '\'': /* Single Quote */
case '\"': /* Double Quote */ case '\"': /* Double Quote */
case '\\': /* Backslash */ case '\\': /* Backslash */
acpi_os_printf("\\%c", (int)string[i]); acpi_os_printf("\\%c", (int)string[i]);
break; break;

View File

@ -603,6 +603,7 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
switch (ACPI_GET_DESCRIPTOR_TYPE switch (ACPI_GET_DESCRIPTOR_TYPE
(descriptor)) { (descriptor)) {
case ACPI_DESC_TYPE_OPERAND: case ACPI_DESC_TYPE_OPERAND:
if (element->size == if (element->size ==
sizeof(union sizeof(union
acpi_operand_object)) acpi_operand_object))
@ -613,6 +614,7 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
break; break;
case ACPI_DESC_TYPE_PARSER: case ACPI_DESC_TYPE_PARSER:
if (element->size == if (element->size ==
sizeof(union sizeof(union
acpi_parse_object)) { acpi_parse_object)) {
@ -622,6 +624,7 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
break; break;
case ACPI_DESC_TYPE_NAMED: case ACPI_DESC_TYPE_NAMED:
if (element->size == if (element->size ==
sizeof(struct sizeof(struct
acpi_namespace_node)) acpi_namespace_node))
@ -632,6 +635,7 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
break; break;
default: default:
break; break;
} }
@ -639,6 +643,7 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
switch (descriptor_type) { switch (descriptor_type) {
case ACPI_DESC_TYPE_OPERAND: case ACPI_DESC_TYPE_OPERAND:
acpi_os_printf acpi_os_printf
("%12.12s RefCount 0x%04X\n", ("%12.12s RefCount 0x%04X\n",
acpi_ut_get_type_name acpi_ut_get_type_name
@ -649,6 +654,7 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
break; break;
case ACPI_DESC_TYPE_PARSER: case ACPI_DESC_TYPE_PARSER:
acpi_os_printf acpi_os_printf
("AmlOpcode 0x%04hX\n", ("AmlOpcode 0x%04hX\n",
descriptor->op.asl. descriptor->op.asl.
@ -656,6 +662,7 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
break; break;
case ACPI_DESC_TYPE_NAMED: case ACPI_DESC_TYPE_NAMED:
acpi_os_printf("%4.4s\n", acpi_os_printf("%4.4s\n",
acpi_ut_get_node_name acpi_ut_get_node_name
(&descriptor-> (&descriptor->
@ -663,6 +670,7 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
break; break;
default: default:
acpi_os_printf("\n"); acpi_os_printf("\n");
break; break;
} }