You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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:
committed by
Rafael J. Wysocki
parent
b6872ff9a4
commit
1d1ea1b723
@@ -78,7 +78,6 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state,
|
||||
|
||||
switch (op->common.aml_opcode) {
|
||||
case AML_WHILE_OP:
|
||||
|
||||
/*
|
||||
* If this is an additional iteration of a while loop, continue.
|
||||
* 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 */
|
||||
|
||||
case AML_IF_OP:
|
||||
|
||||
/*
|
||||
* IF/WHILE: Create a new control state to manage these
|
||||
* 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;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -344,6 +343,7 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
|
||||
case AML_NOOP_OP:
|
||||
|
||||
/* Just do nothing! */
|
||||
|
||||
break;
|
||||
|
||||
case AML_BREAK_POINT_OP:
|
||||
|
||||
@@ -563,21 +563,25 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
|
||||
*/
|
||||
switch (walk_state->opcode) {
|
||||
case AML_FIELD_OP:
|
||||
|
||||
arg = acpi_ps_get_arg(op, 2);
|
||||
type = ACPI_TYPE_LOCAL_REGION_FIELD;
|
||||
break;
|
||||
|
||||
case AML_BANK_FIELD_OP:
|
||||
|
||||
arg = acpi_ps_get_arg(op, 4);
|
||||
type = ACPI_TYPE_LOCAL_BANK_FIELD;
|
||||
break;
|
||||
|
||||
case AML_INDEX_FIELD_OP:
|
||||
|
||||
arg = acpi_ps_get_arg(op, 3);
|
||||
type = ACPI_TYPE_LOCAL_INDEX_FIELD;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
|
||||
@@ -127,6 +127,7 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -285,6 +285,7 @@ acpi_ds_method_data_get_node(u8 type,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR((AE_INFO, "Type %u is invalid", 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);
|
||||
|
||||
case ACPI_REFCLASS_LOCAL:
|
||||
|
||||
/*
|
||||
* No error message for this case, will be trapped again later to
|
||||
* detect and ignore cases of Store(local_x,local_x)
|
||||
|
||||
@@ -648,7 +648,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
||||
|
||||
switch (obj_desc->common.type) {
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* Defer evaluation of Buffer term_arg operand
|
||||
*/
|
||||
@@ -660,7 +659,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
/*
|
||||
* Defer evaluation of Package term_arg operand
|
||||
*/
|
||||
@@ -741,6 +739,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR((AE_INFO, "Unknown Integer type 0x%X",
|
||||
op_info->type));
|
||||
status = AE_AML_OPERAND_TYPE;
|
||||
|
||||
@@ -636,6 +636,7 @@ acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return_ACPI_STATUS(AE_AML_BAD_OPCODE);
|
||||
}
|
||||
|
||||
|
||||
@@ -240,7 +240,6 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
|
||||
|
||||
case AML_IF_OP:
|
||||
case AML_WHILE_OP:
|
||||
|
||||
/*
|
||||
* If we are executing the predicate AND this is the predicate op,
|
||||
* we will use the return value
|
||||
@@ -254,7 +253,9 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Ignore other control opcodes */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -263,7 +264,6 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
|
||||
goto result_not_used;
|
||||
|
||||
case AML_CLASS_CREATE:
|
||||
|
||||
/*
|
||||
* These opcodes allow term_arg(s) as operands and therefore
|
||||
* 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;
|
||||
|
||||
default:
|
||||
|
||||
/*
|
||||
* In all other cases. the parent will actually use the return
|
||||
* object, so keep it.
|
||||
|
||||
@@ -327,6 +327,7 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -488,7 +489,6 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
|
||||
break;
|
||||
|
||||
case AML_TYPE_METHOD_CALL:
|
||||
|
||||
/*
|
||||
* If the method is referenced from within a package
|
||||
* 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) {
|
||||
case AML_NAME_OP:
|
||||
|
||||
/*
|
||||
* Put the Node on the object stack (Contains the ACPI Name
|
||||
* of this object)
|
||||
|
||||
@@ -74,6 +74,7 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number)
|
||||
|
||||
switch (pass_number) {
|
||||
case 1:
|
||||
|
||||
walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 |
|
||||
ACPI_PARSE_DELETE_TREE;
|
||||
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;
|
||||
|
||||
case 2:
|
||||
|
||||
walk_state->parse_flags = ACPI_PARSE_LOAD_PASS1 |
|
||||
ACPI_PARSE_DELETE_TREE;
|
||||
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;
|
||||
|
||||
case 3:
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
walk_state->parse_flags |= ACPI_PARSE_EXECUTE |
|
||||
ACPI_PARSE_DELETE_TREE;
|
||||
@@ -97,6 +100,7 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number)
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
@@ -161,7 +165,6 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
||||
|
||||
switch (walk_state->opcode) {
|
||||
case AML_SCOPE_OP:
|
||||
|
||||
/*
|
||||
* 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.
|
||||
@@ -210,7 +213,6 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* These types we will allow, but we will change the type.
|
||||
* This enables some existing code of the form:
|
||||
@@ -232,7 +234,6 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
|
||||
/*
|
||||
* Allow scope change to root during execution of module-level
|
||||
* code. Root is typed METHOD during this time.
|
||||
|
||||
@@ -509,6 +509,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* All NAMED_FIELD opcodes must be handled above */
|
||||
break;
|
||||
}
|
||||
@@ -548,6 +549,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Unknown opcode */
|
||||
|
||||
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 */
|
||||
|
||||
default:
|
||||
|
||||
/* All NAMED_COMPLEX opcodes must be handled above */
|
||||
break;
|
||||
}
|
||||
@@ -721,6 +724,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
case ACPI_GPE_DISPATCH_NOTIFY:
|
||||
|
||||
/*
|
||||
* Implicit notify.
|
||||
* Dispatch a DEVICE_WAKE notify to the appropriate handler.
|
||||
@@ -582,7 +581,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
|
||||
break;
|
||||
|
||||
default:
|
||||
return_VOID; /* Should never happen */
|
||||
|
||||
return_VOID; /* Should never happen */
|
||||
}
|
||||
|
||||
/* Defer enabling of GPE until all notify handlers are done */
|
||||
@@ -754,7 +754,6 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
|
||||
|
||||
case ACPI_GPE_DISPATCH_METHOD:
|
||||
case ACPI_GPE_DISPATCH_NOTIFY:
|
||||
|
||||
/*
|
||||
* Execute the method associated with the GPE
|
||||
* 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;
|
||||
|
||||
default:
|
||||
|
||||
/*
|
||||
* No handler or method to run!
|
||||
* 03/2010: This case should no longer be possible. We will not allow
|
||||
|
||||
@@ -363,14 +363,17 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,
|
||||
*/
|
||||
switch (name[1]) {
|
||||
case 'L':
|
||||
|
||||
type = ACPI_GPE_LEVEL_TRIGGERED;
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
|
||||
type = ACPI_GPE_EDGE_TRIGGERED;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Unknown method type, just ignore it */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_LOAD,
|
||||
|
||||
@@ -354,36 +354,43 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
|
||||
|
||||
switch (space_id) {
|
||||
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
|
||||
|
||||
handler = acpi_ex_system_memory_space_handler;
|
||||
setup = acpi_ev_system_memory_region_setup;
|
||||
break;
|
||||
|
||||
case ACPI_ADR_SPACE_SYSTEM_IO:
|
||||
|
||||
handler = acpi_ex_system_io_space_handler;
|
||||
setup = acpi_ev_io_space_region_setup;
|
||||
break;
|
||||
|
||||
case ACPI_ADR_SPACE_PCI_CONFIG:
|
||||
|
||||
handler = acpi_ex_pci_config_space_handler;
|
||||
setup = acpi_ev_pci_config_region_setup;
|
||||
break;
|
||||
|
||||
case ACPI_ADR_SPACE_CMOS:
|
||||
|
||||
handler = acpi_ex_cmos_space_handler;
|
||||
setup = acpi_ev_cmos_region_setup;
|
||||
break;
|
||||
|
||||
case ACPI_ADR_SPACE_PCI_BAR_TARGET:
|
||||
|
||||
handler = acpi_ex_pci_bar_space_handler;
|
||||
setup = acpi_ev_pci_bar_region_setup;
|
||||
break;
|
||||
|
||||
case ACPI_ADR_SPACE_DATA_TABLE:
|
||||
|
||||
handler = acpi_ex_data_table_space_handler;
|
||||
setup = NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
status = AE_BAD_PARAMETER;
|
||||
goto unlock_and_exit;
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node)
|
||||
return (TRUE);
|
||||
|
||||
default:
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -596,7 +596,9 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Ignore other objects */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -366,16 +366,19 @@ acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 action)
|
||||
|
||||
switch (action) {
|
||||
case ACPI_GPE_ENABLE:
|
||||
|
||||
ACPI_SET_BIT(gpe_register_info->enable_for_wake,
|
||||
(u8)register_bit);
|
||||
break;
|
||||
|
||||
case ACPI_GPE_DISABLE:
|
||||
|
||||
ACPI_CLEAR_BIT(gpe_register_info->enable_for_wake,
|
||||
(u8)register_bit);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR((AE_INFO, "%u, Invalid action", action));
|
||||
status = AE_BAD_PARAMETER;
|
||||
break;
|
||||
|
||||
@@ -139,6 +139,7 @@ acpi_install_address_space_handler(acpi_handle device,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -480,6 +480,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
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) {
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
/*
|
||||
* Convert string to an integer - for most cases, the string must be
|
||||
* 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:
|
||||
|
||||
/* No other types can get here */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -213,7 +214,6 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
|
||||
return_ACPI_STATUS(AE_OK);
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
/*
|
||||
* Create a new Buffer object.
|
||||
* Need enough space for one integer
|
||||
@@ -233,7 +233,6 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
/*
|
||||
* Create a new Buffer object
|
||||
* Size will be the string length
|
||||
@@ -258,6 +257,7 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
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) {
|
||||
case 1:
|
||||
|
||||
decimal_length = ACPI_MAX8_DECIMAL_DIGITS;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
|
||||
decimal_length = ACPI_MAX32_DECIMAL_DIGITS;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
default:
|
||||
|
||||
decimal_length = ACPI_MAX64_DECIMAL_DIGITS;
|
||||
break;
|
||||
}
|
||||
@@ -546,6 +549,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return_ACPI_STATUS(AE_TYPE);
|
||||
}
|
||||
|
||||
@@ -599,6 +603,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* No conversion allowed for these types */
|
||||
|
||||
if (destination_type != source_desc->common.type) {
|
||||
@@ -649,6 +654,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR((AE_INFO,
|
||||
"Bad destination type during conversion: 0x%X",
|
||||
destination_type));
|
||||
@@ -664,6 +670,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR((AE_INFO,
|
||||
"Unknown Target type ID 0x%X AmlOpcode 0x%X DestType %s",
|
||||
GET_CURRENT_ARG_TYPE(walk_state->op_info->
|
||||
|
||||
@@ -103,7 +103,6 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)
|
||||
case ACPI_TYPE_BUFFER:
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
|
||||
/*
|
||||
* These types open a new scope, so we need the NS node in order to access
|
||||
* 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_THERMAL:
|
||||
case ACPI_TYPE_LOCAL_SCOPE:
|
||||
|
||||
/*
|
||||
* The new alias has the type ALIAS and points to the original
|
||||
* NS node, not the object itself.
|
||||
@@ -124,7 +122,6 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
|
||||
/*
|
||||
* Control method aliases need to be differentiated
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user