Skip to content

Commit

Permalink
ACPICA: Core: Major update for code formatting, no functional changes
Browse files Browse the repository at this point in the history
ACPICA commit dfa394471f6c01b2ee9433dbc143ec70cb9bca72

Mostly indentation inconsistencies across the code. Split
some long lines, etc.

Link: acpica/acpica@dfa39447
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>
  • Loading branch information
acpibob authored and rafaeljw committed Jan 1, 2016
1 parent cd162b3 commit 1fad873
Show file tree
Hide file tree
Showing 100 changed files with 634 additions and 493 deletions.
1 change: 1 addition & 0 deletions drivers/acpi/acpica/dbstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ acpi_status acpi_db_display_statistics(char *type_arg)
acpi_gbl_node_type_count[i],
acpi_gbl_obj_type_count[i]);
}

acpi_os_printf("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
acpi_gbl_node_type_count_misc,
acpi_gbl_obj_type_count_misc);
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/acpica/dbutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ void acpi_db_dump_external_object(union acpi_object *obj_desc, u32 level)
if (obj_desc->buffer.length > 16) {
acpi_os_printf("\n");
}

acpi_ut_debug_dump_buffer(ACPI_CAST_PTR
(u8,
obj_desc->buffer.pointer),
Expand Down
7 changes: 4 additions & 3 deletions drivers/acpi/acpica/dsargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc)
extra_desc = acpi_ns_get_secondary_object(obj_desc);
node = obj_desc->buffer_field.node;

ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname(ACPI_TYPE_BUFFER_FIELD,
node, NULL));
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname
(ACPI_TYPE_BUFFER_FIELD, node, NULL));

ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
acpi_ut_get_node_name(node)));
Expand Down Expand Up @@ -385,7 +385,8 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc)
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname
(ACPI_TYPE_REGION, node, NULL));

ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n",
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"[%4.4s] OpRegion Arg Init at AML %p\n",
acpi_ut_get_node_name(node),
extra_desc->extra.aml_start));

Expand Down
5 changes: 3 additions & 2 deletions drivers/acpi/acpica/dsdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ acpi_ds_dump_method_stack(acpi_status status,
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"\n**** Exception %s during execution of method ",
acpi_format_exception(status)));

acpi_ds_print_node_pathname(walk_state->method_node, NULL);

/* Display stack of executing methods */
Expand Down Expand Up @@ -203,8 +204,8 @@ acpi_ds_dump_method_stack(acpi_status status,
} else {
/*
* This method has called another method
* NOTE: the method call parse subtree is already deleted at this
* point, so we cannot disassemble the method invocation.
* NOTE: the method call parse subtree is already deleted at
* this point, so we cannot disassemble the method invocation.
*/
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DISPATCH,
"Call to method "));
Expand Down
39 changes: 20 additions & 19 deletions drivers/acpi/acpica/dsfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ acpi_ds_create_external_region(acpi_status lookup_status,
* insert the name into the namespace.
*/
acpi_dm_add_op_to_external_list(op, path, ACPI_TYPE_REGION, 0, 0);

status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION,
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
walk_state, node);
Expand Down Expand Up @@ -202,11 +203,10 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,

/* Enter the name_string into the namespace */

status =
acpi_ns_lookup(walk_state->scope_info,
arg->common.value.string, ACPI_TYPE_ANY,
ACPI_IMODE_LOAD_PASS1, flags, walk_state,
&node);
status = acpi_ns_lookup(walk_state->scope_info,
arg->common.value.string, ACPI_TYPE_ANY,
ACPI_IMODE_LOAD_PASS1, flags,
walk_state, &node);
if (ACPI_FAILURE(status)) {
ACPI_ERROR_NAMESPACE(arg->common.value.string, status);
return_ACPI_STATUS(status);
Expand Down Expand Up @@ -244,8 +244,8 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
}

/*
* Remember location in AML stream of the field unit opcode and operands --
* since the buffer and index operands must be evaluated.
* Remember location in AML stream of the field unit opcode and operands
* -- since the buffer and index operands must be evaluated.
*/
second_desc = obj_desc->common.next_object;
second_desc->extra.aml_start = op->named.data;
Expand Down Expand Up @@ -310,8 +310,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
switch (arg->common.aml_opcode) {
case AML_INT_RESERVEDFIELD_OP:

position = (u64)info->field_bit_position
+ (u64)arg->common.value.size;
position = (u64)info->field_bit_position +
(u64)arg->common.value.size;

if (position > ACPI_UINT32_MAX) {
ACPI_ERROR((AE_INFO,
Expand Down Expand Up @@ -344,13 +344,13 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,

/* access_attribute (attrib_quick, attrib_byte, etc.) */

info->attribute =
(u8)((arg->common.value.integer >> 8) & 0xFF);
info->attribute = (u8)
((arg->common.value.integer >> 8) & 0xFF);

/* access_length (for serial/buffer protocols) */

info->access_length =
(u8)((arg->common.value.integer >> 16) & 0xFF);
info->access_length = (u8)
((arg->common.value.integer >> 16) & 0xFF);
break;

case AML_INT_CONNECTION_OP:
Expand Down Expand Up @@ -425,8 +425,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,

/* Keep track of bit position for the next field */

position = (u64)info->field_bit_position
+ (u64)arg->common.value.size;
position = (u64)info->field_bit_position +
(u64)arg->common.value.size;

if (position > ACPI_UINT32_MAX) {
ACPI_ERROR((AE_INFO,
Expand Down Expand Up @@ -716,11 +716,12 @@ acpi_ds_create_bank_field(union acpi_parse_object *op,

/*
* Use Info.data_register_node to store bank_field Op
* It's safe because data_register_node will never be used when create bank field
* We store aml_start and aml_length in the bank_field Op for late evaluation
* Used in acpi_ex_prep_field_value(Info)
* It's safe because data_register_node will never be used when create
* bank field \we store aml_start and aml_length in the bank_field Op for
* late evaluation. Used in acpi_ex_prep_field_value(Info)
*
* TBD: Or, should we add a field in struct acpi_create_field_info, like "void *ParentOp"?
* TBD: Or, should we add a field in struct acpi_create_field_info, like
* "void *ParentOp"?
*/
info.data_register_node = (struct acpi_namespace_node *)op;

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/dsinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ acpi_ds_initialize_objects(u32 table_index,
/* Summary of objects initialized */

ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"Table [%4.4s:%8.8s] (id %.2X) - %4u Objects with %3u Devices, "
"Table [%4.4s: %-8.8s] (id %.2X) - %4u Objects with %3u Devices, "
"%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n",
table->signature, table->oem_table_id, owner_id,
info.object_count, info.device_count,
Expand Down
24 changes: 14 additions & 10 deletions drivers/acpi/acpica/dsmethod.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,9 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
return_ACPI_STATUS(AE_NO_MEMORY);
}

status =
acpi_ds_init_aml_walk(walk_state, op, node,
obj_desc->method.aml_start,
obj_desc->method.aml_length, NULL, 0);
status = acpi_ds_init_aml_walk(walk_state, op, node,
obj_desc->method.aml_start,
obj_desc->method.aml_length, NULL, 0);
if (ACPI_FAILURE(status)) {
acpi_ds_delete_walk_state(walk_state);
acpi_ps_free_op(op);
Expand Down Expand Up @@ -375,7 +374,8 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
&& (walk_state->thread->current_sync_level >
obj_desc->method.mutex->mutex.sync_level)) {
ACPI_ERROR((AE_INFO,
"Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%u)",
"Cannot acquire Mutex for method [%4.4s]"
", current SyncLevel is too large (%u)",
acpi_ut_get_node_name(method_node),
walk_state->thread->current_sync_level));

Expand Down Expand Up @@ -512,16 +512,18 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,

/* Init for new method, possibly wait on method mutex */

status = acpi_ds_begin_method_execution(method_node, obj_desc,
this_walk_state);
status =
acpi_ds_begin_method_execution(method_node, obj_desc,
this_walk_state);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}

/* Begin method parse/execution. Create a new walk state */

next_walk_state = acpi_ds_create_walk_state(obj_desc->method.owner_id,
NULL, obj_desc, thread);
next_walk_state =
acpi_ds_create_walk_state(obj_desc->method.owner_id, NULL, obj_desc,
thread);
if (!next_walk_state) {
status = AE_NO_MEMORY;
goto cleanup;
Expand Down Expand Up @@ -808,7 +810,8 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
info_flags & ACPI_METHOD_SERIALIZED_PENDING) {
if (walk_state) {
ACPI_INFO((AE_INFO,
"Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",
"Marking method %4.4s as Serialized "
"because of AE_ALREADY_EXISTS error",
walk_state->method_node->name.
ascii));
}
Expand All @@ -826,6 +829,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
*/
method_desc->method.info_flags &=
~ACPI_METHOD_SERIALIZED_PENDING;

method_desc->method.info_flags |=
(ACPI_METHOD_SERIALIZED |
ACPI_METHOD_IGNORE_SYNC_LEVEL);
Expand Down
20 changes: 11 additions & 9 deletions drivers/acpi/acpica/dsmthdat.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state)
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) {
ACPI_MOVE_32_TO_32(&walk_state->arguments[i].name,
NAMEOF_ARG_NTE);

walk_state->arguments[i].name.integer |= (i << 24);
walk_state->arguments[i].descriptor_type = ACPI_DESC_TYPE_NAMED;
walk_state->arguments[i].type = ACPI_TYPE_ANY;
Expand Down Expand Up @@ -201,7 +202,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,

if (!params) {
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"No param list passed to method\n"));
"No parameter list passed to method\n"));
return_ACPI_STATUS(AE_OK);
}

Expand All @@ -214,9 +215,9 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
* Store the argument in the method/walk descriptor.
* Do not copy the arg in order to implement call by reference
*/
status = acpi_ds_method_data_set_value(ACPI_REFCLASS_ARG, index,
params[index],
walk_state);
status =
acpi_ds_method_data_set_value(ACPI_REFCLASS_ARG, index,
params[index], walk_state);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
Expand Down Expand Up @@ -610,11 +611,11 @@ acpi_ds_store_object_to_local(u8 type,
* do the indirect store
*/
if ((ACPI_GET_DESCRIPTOR_TYPE(current_obj_desc) ==
ACPI_DESC_TYPE_OPERAND)
&& (current_obj_desc->common.type ==
ACPI_TYPE_LOCAL_REFERENCE)
&& (current_obj_desc->reference.class ==
ACPI_REFCLASS_REFOF)) {
ACPI_DESC_TYPE_OPERAND) &&
(current_obj_desc->common.type ==
ACPI_TYPE_LOCAL_REFERENCE) &&
(current_obj_desc->reference.class ==
ACPI_REFCLASS_REFOF)) {
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"Arg (%p) is an ObjRef(Node), storing in node %p\n",
new_obj_desc,
Expand All @@ -638,6 +639,7 @@ acpi_ds_store_object_to_local(u8 type,
if (new_obj_desc != obj_desc) {
acpi_ut_remove_reference(new_obj_desc);
}

return_ACPI_STATUS(status);
}
}
Expand Down
19 changes: 11 additions & 8 deletions drivers/acpi/acpica/dsobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,10 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
arg->common.node);
}
} else {
status = acpi_ds_build_internal_object(walk_state, arg,
&obj_desc->
package.
elements[i]);
status =
acpi_ds_build_internal_object(walk_state, arg,
&obj_desc->package.
elements[i]);
}

if (*obj_desc_ptr) {
Expand Down Expand Up @@ -525,15 +525,17 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
}

ACPI_INFO((AE_INFO,
"Actual Package length (%u) is larger than NumElements field (%u), truncated",
"Actual Package length (%u) is larger than "
"NumElements field (%u), truncated",
i, element_count));
} else if (i < element_count) {
/*
* Arg list (elements) was exhausted, but we did not reach num_elements count.
* Note: this is not an error, the package is padded out with NULLs.
*/
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Package List length (%u) smaller than NumElements count (%u), padded with null elements\n",
"Package List length (%u) smaller than NumElements "
"count (%u), padded with null elements\n",
i, element_count));
}

Expand Down Expand Up @@ -584,8 +586,9 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state,

/* Build an internal object for the argument(s) */

status = acpi_ds_build_internal_object(walk_state, op->common.value.arg,
&obj_desc);
status =
acpi_ds_build_internal_object(walk_state, op->common.value.arg,
&obj_desc);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
Expand Down
21 changes: 12 additions & 9 deletions drivers/acpi/acpica/dsopcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,9 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
* For field_flags, use LOCK_RULE = 0 (NO_LOCK),
* UPDATE_RULE = 0 (UPDATE_PRESERVE)
*/
status = acpi_ex_prep_common_field_object(obj_desc, field_flags, 0,
bit_offset, bit_count);
status =
acpi_ex_prep_common_field_object(obj_desc, field_flags, 0,
bit_offset, bit_count);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
Expand Down Expand Up @@ -330,8 +331,9 @@ acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state,

/* Resolve the operands */

status = acpi_ex_resolve_operands(op->common.aml_opcode,
ACPI_WALK_OPERANDS, walk_state);
status =
acpi_ex_resolve_operands(op->common.aml_opcode, ACPI_WALK_OPERANDS,
walk_state);
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO, "(%s) bad operand(s), status 0x%X",
acpi_ps_get_opcode_name(op->common.aml_opcode),
Expand Down Expand Up @@ -414,8 +416,9 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,

/* Resolve the length and address operands to numbers */

status = acpi_ex_resolve_operands(op->common.aml_opcode,
ACPI_WALK_OPERANDS, walk_state);
status =
acpi_ex_resolve_operands(op->common.aml_opcode, ACPI_WALK_OPERANDS,
walk_state);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
Expand Down Expand Up @@ -452,7 +455,6 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
/* Now the address and length are valid for this opregion */

obj_desc->region.flags |= AOPOBJ_DATA_VALID;

return_ACPI_STATUS(status);
}

Expand Down Expand Up @@ -510,8 +512,9 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
* Resolve the Signature string, oem_id string,
* and oem_table_id string operands
*/
status = acpi_ex_resolve_operands(op->common.aml_opcode,
ACPI_WALK_OPERANDS, walk_state);
status =
acpi_ex_resolve_operands(op->common.aml_opcode, ACPI_WALK_OPERANDS,
walk_state);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
Expand Down
Loading

0 comments on commit 1fad873

Please sign in to comment.