ACPICA: Formatting update - no functional changes

Split long lines, update comments.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Bob Moore 2009-03-06 10:05:18 +08:00 committed by Len Brown
parent 768aaaf196
commit d4913dc6d0
21 changed files with 161 additions and 174 deletions

View file

@ -88,10 +88,10 @@ acpi_ev_set_gpe_type(struct acpi_gpe_event_info *gpe_event_info, u8 type)
status = acpi_ev_disable_gpe(gpe_event_info); status = acpi_ev_disable_gpe(gpe_event_info);
/* Type was validated above */ /* Clear the type bits and insert the new Type */
gpe_event_info->flags &= ~ACPI_GPE_TYPE_MASK; /* Clear type bits */ gpe_event_info->flags &= ~ACPI_GPE_TYPE_MASK;
gpe_event_info->flags |= type; /* Insert type */ gpe_event_info->flags |= type;
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
@ -122,6 +122,7 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info,
if (!gpe_register_info) { if (!gpe_register_info) {
return_ACPI_STATUS(AE_NOT_EXIST); return_ACPI_STATUS(AE_NOT_EXIST);
} }
register_bit = (u8) register_bit = (u8)
(1 << (1 <<
(gpe_event_info->gpe_number - gpe_register_info->base_gpe_number)); (gpe_event_info->gpe_number - gpe_register_info->base_gpe_number));

View file

@ -104,8 +104,8 @@ u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info)
while (gpe_block) { while (gpe_block) {
if ((&gpe_block->event_info[0] <= gpe_event_info) && if ((&gpe_block->event_info[0] <= gpe_event_info) &&
(&gpe_block-> (&gpe_block->event_info[((acpi_size)
event_info[((acpi_size) gpe_block-> gpe_block->
register_count) * 8] > register_count) * 8] >
gpe_event_info)) { gpe_event_info)) {
return (TRUE); return (TRUE);
@ -210,10 +210,9 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
/* Now look at the individual GPEs in this byte register */ /* Now look at the individual GPEs in this byte register */
for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
gpe_event_info = gpe_event_info = &gpe_block->event_info[((acpi_size) i *
&gpe_block-> ACPI_GPE_REGISTER_WIDTH)
event_info[((acpi_size) i * + j];
ACPI_GPE_REGISTER_WIDTH) + j];
if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_HANDLER) { ACPI_GPE_DISPATCH_HANDLER) {
@ -293,8 +292,8 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
/* Unknown method type, just ignore it! */ /* Unknown method type, just ignore it! */
ACPI_DEBUG_PRINT((ACPI_DB_LOAD, ACPI_DEBUG_PRINT((ACPI_DB_LOAD,
"Ignoring unknown GPE method type: %s (name not of form _Lxx or _Exx)", "Ignoring unknown GPE method type: %s "
name)); "(name not of form _Lxx or _Exx)", name));
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
@ -306,16 +305,15 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
/* Conversion failed; invalid method, just ignore it */ /* Conversion failed; invalid method, just ignore it */
ACPI_DEBUG_PRINT((ACPI_DB_LOAD, ACPI_DEBUG_PRINT((ACPI_DB_LOAD,
"Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)", "Could not extract GPE number from name: %s "
name)); "(name is not of form _Lxx or _Exx)", name));
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
/* Ensure that we have a valid GPE number for this GPE block */ /* Ensure that we have a valid GPE number for this GPE block */
if ((gpe_number < gpe_block->block_base_number) || if ((gpe_number < gpe_block->block_base_number) ||
(gpe_number >= (gpe_number >= (gpe_block->block_base_number +
(gpe_block->block_base_number +
(gpe_block->register_count * 8)))) { (gpe_block->register_count * 8)))) {
/* /*
* Not valid for this GPE block, just ignore it. However, it may be * Not valid for this GPE block, just ignore it. However, it may be
@ -423,8 +421,8 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
if ((obj_desc->package.count < 2) || if ((obj_desc->package.count < 2) ||
((obj_desc->package.elements[0])->common.type != ((obj_desc->package.elements[0])->common.type !=
ACPI_TYPE_LOCAL_REFERENCE) ACPI_TYPE_LOCAL_REFERENCE) ||
|| ((obj_desc->package.elements[1])->common.type != ((obj_desc->package.elements[1])->common.type !=
ACPI_TYPE_INTEGER)) { ACPI_TYPE_INTEGER)) {
goto cleanup; goto cleanup;
} }
@ -450,11 +448,11 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
*/ */
if ((gpe_device == target_gpe_device) && if ((gpe_device == target_gpe_device) &&
(gpe_number >= gpe_block->block_base_number) && (gpe_number >= gpe_block->block_base_number) &&
(gpe_number < (gpe_number < gpe_block->block_base_number +
gpe_block->block_base_number + (gpe_block->register_count * 8))) { (gpe_block->register_count * 8))) {
gpe_event_info = gpe_event_info = &gpe_block->event_info[gpe_number -
&gpe_block->event_info[gpe_number - gpe_block->
gpe_block->block_base_number]; block_base_number];
/* Mark GPE for WAKE-ONLY but WAKE_DISABLED */ /* Mark GPE for WAKE-ONLY but WAKE_DISABLED */
@ -1033,8 +1031,8 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
* 1) are "runtime" or "run/wake" GPEs, and * 1) are "runtime" or "run/wake" GPEs, and
* 2) have a corresponding _Lxx or _Exx method * 2) have a corresponding _Lxx or _Exx method
* *
* Any other GPEs within this block must be enabled via the acpi_enable_gpe() * Any other GPEs within this block must be enabled via the
* external interface. * acpi_enable_gpe() external interface.
*/ */
wake_gpe_count = 0; wake_gpe_count = 0;
gpe_enabled_count = 0; gpe_enabled_count = 0;
@ -1044,14 +1042,13 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
/* Get the info block for this particular GPE */ /* Get the info block for this particular GPE */
gpe_event_info = gpe_event_info = &gpe_block->event_info[((acpi_size) i *
&gpe_block-> ACPI_GPE_REGISTER_WIDTH)
event_info[((acpi_size) i * + j];
ACPI_GPE_REGISTER_WIDTH) + j];
if (((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == if (((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_METHOD) ACPI_GPE_DISPATCH_METHOD) &&
&& (gpe_event_info->flags & ACPI_GPE_TYPE_RUNTIME)) { (gpe_event_info->flags & ACPI_GPE_TYPE_RUNTIME)) {
gpe_enabled_count++; gpe_enabled_count++;
} }
@ -1105,8 +1102,8 @@ acpi_status acpi_ev_gpe_initialize(void)
/* /*
* Initialize the GPE Block(s) defined in the FADT * Initialize the GPE Block(s) defined in the FADT
* *
* Why the GPE register block lengths are divided by 2: From the ACPI Spec, * Why the GPE register block lengths are divided by 2: From the ACPI
* section "General-Purpose Event Registers", we have: * Spec, section "General-Purpose Event Registers", we have:
* *
* "Each register block contains two registers of equal length * "Each register block contains two registers of equal length
* GPEx_STS and GPEx_EN (where x is 0 or 1). The length of the * GPEx_STS and GPEx_EN (where x is 0 or 1). The length of the
@ -1163,7 +1160,8 @@ acpi_status acpi_ev_gpe_initialize(void)
if ((register_count0) && if ((register_count0) &&
(gpe_number_max >= acpi_gbl_FADT.gpe1_base)) { (gpe_number_max >= acpi_gbl_FADT.gpe1_base)) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"GPE0 block (GPE 0 to %d) overlaps the GPE1 block (GPE %d to %d) - Ignoring GPE1", "GPE0 block (GPE 0 to %d) overlaps the GPE1 block "
"(GPE %d to %d) - Ignoring GPE1",
gpe_number_max, acpi_gbl_FADT.gpe1_base, gpe_number_max, acpi_gbl_FADT.gpe1_base,
acpi_gbl_FADT.gpe1_base + acpi_gbl_FADT.gpe1_base +
((register_count1 * ((register_count1 *

View file

@ -163,10 +163,10 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
* 2) Global device notify handler * 2) Global device notify handler
* 3) Per-device notify handler * 3) Per-device notify handler
*/ */
if ((acpi_gbl_system_notify.handler if ((acpi_gbl_system_notify.handler &&
&& (notify_value <= ACPI_MAX_SYS_NOTIFY)) (notify_value <= ACPI_MAX_SYS_NOTIFY)) ||
|| (acpi_gbl_device_notify.handler (acpi_gbl_device_notify.handler &&
&& (notify_value > ACPI_MAX_SYS_NOTIFY)) || handler_obj) { (notify_value > ACPI_MAX_SYS_NOTIFY)) || handler_obj) {
notify_info = acpi_ut_create_generic_state(); notify_info = acpi_ut_create_generic_state();
if (!notify_info) { if (!notify_info) {
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
@ -174,7 +174,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
if (!handler_obj) { if (!handler_obj) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Executing system notify handler for Notify (%4.4s, %X) node %p\n", "Executing system notify handler for Notify (%4.4s, %X) "
"node %p\n",
acpi_ut_get_node_name(node), acpi_ut_get_node_name(node),
notify_value, node)); notify_value, node));
} }

View file

@ -703,7 +703,8 @@ acpi_ev_install_handler(acpi_handle obj_handle,
if (next_handler_obj->address_space.space_id == if (next_handler_obj->address_space.space_id ==
handler_obj->address_space.space_id) { handler_obj->address_space.space_id) {
ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
"Found handler for region [%s] in device %p(%p) handler %p\n", "Found handler for region [%s] in device %p(%p) "
"handler %p\n",
acpi_ut_get_region_name acpi_ut_get_region_name
(handler_obj->address_space. (handler_obj->address_space.
space_id), obj_desc, space_id), obj_desc,

View file

@ -241,7 +241,8 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
status = AE_OK; status = AE_OK;
} else { } else {
ACPI_EXCEPTION((AE_INFO, status, ACPI_EXCEPTION((AE_INFO, status,
"Could not install PciConfig handler for Root Bridge %4.4s", "Could not install PciConfig handler "
"for Root Bridge %4.4s",
acpi_ut_get_node_name acpi_ut_get_node_name
(pci_root_node))); (pci_root_node)));
} }
@ -293,9 +294,8 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
* Get the PCI device and function numbers from the _ADR object contained * Get the PCI device and function numbers from the _ADR object contained
* in the parent's scope. * in the parent's scope.
*/ */
status = status = acpi_ut_evaluate_numeric_object(METHOD_NAME__ADR,
acpi_ut_evaluate_numeric_object(METHOD_NAME__ADR, pci_device_node, pci_device_node, &pci_value);
&pci_value);
/* /*
* The default is zero, and since the allocation above zeroed the data, * The default is zero, and since the allocation above zeroed the data,
@ -308,18 +308,16 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
/* The PCI segment number comes from the _SEG method */ /* The PCI segment number comes from the _SEG method */
status = status = acpi_ut_evaluate_numeric_object(METHOD_NAME__SEG,
acpi_ut_evaluate_numeric_object(METHOD_NAME__SEG, pci_root_node, pci_root_node, &pci_value);
&pci_value);
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
pci_id->segment = ACPI_LOWORD(pci_value); pci_id->segment = ACPI_LOWORD(pci_value);
} }
/* The PCI bus number comes from the _BBN method */ /* The PCI bus number comes from the _BBN method */
status = status = acpi_ut_evaluate_numeric_object(METHOD_NAME__BBN,
acpi_ut_evaluate_numeric_object(METHOD_NAME__BBN, pci_root_node, pci_root_node, &pci_value);
&pci_value);
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
pci_id->bus = ACPI_LOWORD(pci_value); pci_id->bus = ACPI_LOWORD(pci_value);
} }
@ -632,8 +630,8 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
acpi_ns_locked); acpi_ns_locked);
/* /*
* Tell all users that this region is usable by running the _REG * Tell all users that this region is usable by
* method * running the _REG method
*/ */
if (acpi_ns_locked) { if (acpi_ns_locked) {
status = status =

View file

@ -631,7 +631,8 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
/* Setup up dispatch flags to indicate handler (vs. method) */ /* Setup up dispatch flags to indicate handler (vs. method) */
gpe_event_info->flags &= ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); /* Clear bits */ gpe_event_info->flags &=
~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
gpe_event_info->flags |= (u8) (type | ACPI_GPE_DISPATCH_HANDLER); gpe_event_info->flags |= (u8) (type | ACPI_GPE_DISPATCH_HANDLER);
acpi_os_release_lock(acpi_gbl_gpe_lock, flags); acpi_os_release_lock(acpi_gbl_gpe_lock, flags);

View file

@ -193,7 +193,8 @@ acpi_remove_address_space_handler(acpi_handle device,
/* Matched space_id, first dereference this in the Regions */ /* Matched space_id, first dereference this in the Regions */
ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
"Removing address handler %p(%p) for region %s on Device %p(%p)\n", "Removing address handler %p(%p) for region %s "
"on Device %p(%p)\n",
handler_obj, handler, handler_obj, handler,
acpi_ut_get_region_name(space_id), acpi_ut_get_region_name(space_id),
node, obj_desc)); node, obj_desc));

View file

@ -86,7 +86,8 @@ acpi_status acpi_hw_set_mode(u32 mode)
*/ */
if (!acpi_gbl_FADT.acpi_enable && !acpi_gbl_FADT.acpi_disable) { if (!acpi_gbl_FADT.acpi_enable && !acpi_gbl_FADT.acpi_disable) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"No ACPI mode transition supported in this system (enable/disable both zero)")); "No ACPI mode transition supported in this system "
"(enable/disable both zero)"));
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }

View file

@ -89,8 +89,7 @@ acpi_status acpi_hw_low_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
/* Clear just the bit that corresponds to this GPE */ /* Clear just the bit that corresponds to this GPE */
ACPI_CLEAR_BIT(enable_mask, ACPI_CLEAR_BIT(enable_mask, ((u32)1 <<
((u32) 1 <<
(gpe_event_info->gpe_number - (gpe_event_info->gpe_number -
gpe_register_info->base_gpe_number))); gpe_register_info->base_gpe_number)));
@ -156,8 +155,7 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
register_bit = (u8) register_bit = (u8)(1 <<
(1 <<
(gpe_event_info->gpe_number - (gpe_event_info->gpe_number -
gpe_event_info->register_info->base_gpe_number)); gpe_event_info->register_info->base_gpe_number));
@ -206,8 +204,7 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
/* Get the register bitmask for this GPE */ /* Get the register bitmask for this GPE */
register_bit = (u8) register_bit = (u8)(1 <<
(1 <<
(gpe_event_info->gpe_number - (gpe_event_info->gpe_number -
gpe_event_info->register_info->base_gpe_number)); gpe_event_info->register_info->base_gpe_number));

View file

@ -349,8 +349,8 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
* Wait ten seconds, then try again. This is to get S4/S5 to work on * Wait ten seconds, then try again. This is to get S4/S5 to work on
* all machines. * all machines.
* *
* We wait so long to allow chipsets that poll this reg very slowly to * We wait so long to allow chipsets that poll this reg very slowly
* still read the right value. Ideally, this block would go * to still read the right value. Ideally, this block would go
* away entirely. * away entirely.
*/ */
acpi_os_stall(10000000); acpi_os_stall(10000000);
@ -501,12 +501,10 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)
/* Insert the SLP_TYP bits */ /* Insert the SLP_TYP bits */
pm1a_control |= pm1a_control |= (acpi_gbl_sleep_type_a <<
(acpi_gbl_sleep_type_a << sleep_type_reg_info-> sleep_type_reg_info->bit_position);
bit_position); pm1b_control |= (acpi_gbl_sleep_type_b <<
pm1b_control |= sleep_type_reg_info->bit_position);
(acpi_gbl_sleep_type_b << sleep_type_reg_info->
bit_position);
/* Write the control registers and ignore any errors */ /* Write the control registers and ignore any errors */

View file

@ -494,7 +494,8 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
((info->return_object->package.elements[1])->common.type ((info->return_object->package.elements[1])->common.type
!= ACPI_TYPE_INTEGER)) { != ACPI_TYPE_INTEGER)) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Sleep State return package elements are not both Integers (%s, %s)", "Sleep State return package elements are not both Integers "
"(%s, %s)",
acpi_ut_get_object_type_name(info->return_object-> acpi_ut_get_object_type_name(info->return_object->
package.elements[0]), package.elements[0]),
acpi_ut_get_object_type_name(info->return_object-> acpi_ut_get_object_type_name(info->return_object->

View file

@ -118,9 +118,8 @@ acpi_status acpi_ns_root_initialize(void)
} }
/* /*
* Name entered successfully. * Name entered successfully. If entry in pre_defined_names[] specifies
* If entry in pre_defined_names[] specifies an * an initial value, create the initial value.
* initial value, create the initial value.
*/ */
if (init_val->val) { if (init_val->val) {
status = acpi_os_predefined_override(init_val, &val); status = acpi_os_predefined_override(init_val, &val);
@ -178,9 +177,8 @@ acpi_status acpi_ns_root_initialize(void)
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
/* /* Build an object around the static string */
* Build an object around the static string
*/
obj_desc->string.length = obj_desc->string.length =
(u32) ACPI_STRLEN(val); (u32) ACPI_STRLEN(val);
obj_desc->string.pointer = val; obj_desc->string.pointer = val;
@ -314,10 +312,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
return_ACPI_STATUS(AE_NO_NAMESPACE); return_ACPI_STATUS(AE_NO_NAMESPACE);
} }
/* /* Get the prefix scope. A null scope means use the root scope */
* Get the prefix scope.
* A null scope means use the root scope
*/
if ((!scope_info) || (!scope_info->scope.node)) { if ((!scope_info) || (!scope_info->scope.node)) {
ACPI_DEBUG_PRINT((ACPI_DB_NAMES, ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
"Null scope prefix, using root node (%p)\n", "Null scope prefix, using root node (%p)\n",
@ -337,8 +333,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
if (!(flags & ACPI_NS_PREFIX_IS_SCOPE)) { if (!(flags & ACPI_NS_PREFIX_IS_SCOPE)) {
/* /*
* This node might not be a actual "scope" node (such as a * This node might not be a actual "scope" node (such as a
* Device/Method, etc.) It could be a Package or other object node. * Device/Method, etc.) It could be a Package or other object
* Backup up the tree to find the containing scope node. * node. Backup up the tree to find the containing scope node.
*/ */
while (!acpi_ns_opens_scope(prefix_node->type) && while (!acpi_ns_opens_scope(prefix_node->type) &&
prefix_node->type != ACPI_TYPE_ANY) { prefix_node->type != ACPI_TYPE_ANY) {
@ -348,7 +344,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
} }
} }
/* Save type TBD: may be no longer necessary */ /* Save type. TBD: may be no longer necessary */
type_to_check_for = type; type_to_check_for = type;
@ -413,6 +409,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
/* Name is fully qualified, no search rules apply */ /* Name is fully qualified, no search rules apply */
search_parent_flag = ACPI_NS_NO_UPSEARCH; search_parent_flag = ACPI_NS_NO_UPSEARCH;
/* /*
* Point past this prefix to the name segment * Point past this prefix to the name segment
* part or the next Parent Prefix * part or the next Parent Prefix
@ -428,7 +425,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
/* Current scope has no parent scope */ /* Current scope has no parent scope */
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"ACPI path has too many parent prefixes (^) - reached beyond root node")); "ACPI path has too many parent prefixes (^) "
"- reached beyond root node"));
return_ACPI_STATUS(AE_NOT_FOUND); return_ACPI_STATUS(AE_NOT_FOUND);
} }
} }
@ -530,9 +528,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
while (num_segments && current_node) { while (num_segments && current_node) {
num_segments--; num_segments--;
if (!num_segments) { if (!num_segments) {
/*
* This is the last segment, enable typechecking /* This is the last segment, enable typechecking */
*/
this_search_type = type; this_search_type = type;
/* /*
@ -583,9 +581,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
if (num_segments > 0) { if (num_segments > 0) {
/* /*
* If we have an alias to an object that opens a scope (such as a * If we have an alias to an object that opens a scope (such as a
* device or processor), we need to dereference the alias here so that * device or processor), we need to dereference the alias here so
* we can access any children of the original node (via the remaining * that we can access any children of the original node (via the
* segments). * remaining segments).
*/ */
if (this_node->type == ACPI_TYPE_LOCAL_ALIAS) { if (this_node->type == ACPI_TYPE_LOCAL_ALIAS) {
if (!this_node->object) { if (!this_node->object) {
@ -593,8 +591,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
} }
if (acpi_ns_opens_scope if (acpi_ns_opens_scope
(((struct acpi_namespace_node *)this_node-> (((struct acpi_namespace_node *)
object)->type)) { this_node->object)->type)) {
this_node = this_node =
(struct acpi_namespace_node *) (struct acpi_namespace_node *)
this_node->object; this_node->object;
@ -638,8 +636,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
/* /*
* If this is the last name segment and we are not looking for a * If this is the last name segment and we are not looking for a
* specific type, but the type of found object is known, use that type * specific type, but the type of found object is known, use that
* to (later) see if it opens a scope. * type to (later) see if it opens a scope.
*/ */
if (type == ACPI_TYPE_ANY) { if (type == ACPI_TYPE_ANY) {
type = this_node->type; type = this_node->type;
@ -652,9 +650,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
current_node = this_node; current_node = this_node;
} }
/* /* Always check if we need to open a new scope */
* Always check if we need to open a new scope
*/
if (!(flags & ACPI_NS_DONT_OPEN_SCOPE) && (walk_state)) { if (!(flags & ACPI_NS_DONT_OPEN_SCOPE) && (walk_state)) {
/* /*
* If entry is a type which opens a scope, push the new scope on the * If entry is a type which opens a scope, push the new scope on the

View file

@ -76,8 +76,7 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name)
ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_allocated++); ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_allocated++);
#ifdef ACPI_DBG_TRACK_ALLOCATIONS #ifdef ACPI_DBG_TRACK_ALLOCATIONS
temp = temp = acpi_gbl_ns_node_list->total_allocated -
acpi_gbl_ns_node_list->total_allocated -
acpi_gbl_ns_node_list->total_freed; acpi_gbl_ns_node_list->total_freed;
if (temp > acpi_gbl_ns_node_list->max_occupied) { if (temp > acpi_gbl_ns_node_list->max_occupied) {
acpi_gbl_ns_node_list->max_occupied = temp; acpi_gbl_ns_node_list->max_occupied = temp;
@ -145,9 +144,8 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node)
ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_freed++); ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_freed++);
/* /* Detach an object if there is one, then delete the node */
* Detach an object if there is one, then delete the node
*/
acpi_ns_detach_object(node); acpi_ns_detach_object(node);
(void)acpi_os_release_object(acpi_gbl_namespace_cache, node); (void)acpi_os_release_object(acpi_gbl_namespace_cache, node);
return_VOID; return_VOID;
@ -183,9 +181,8 @@ void acpi_ns_install_node(struct acpi_walk_state *walk_state, struct acpi_namesp
ACPI_FUNCTION_TRACE(ns_install_node); ACPI_FUNCTION_TRACE(ns_install_node);
/* /*
* Get the owner ID from the Walk state * Get the owner ID from the Walk state. The owner ID is used to track
* The owner ID is used to track table deletion and * table deletion and deletion of objects created by methods.
* deletion of objects created by methods
*/ */
if (walk_state) { if (walk_state) {
owner_id = walk_state->owner_id; owner_id = walk_state->owner_id;
@ -260,9 +257,8 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
return_VOID; return_VOID;
} }
/* /* Deallocate all children at this level */
* Deallocate all children at this level
*/
do { do {
/* Get the things we need */ /* Get the things we need */
@ -285,9 +281,8 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
"Object %p, Remaining %X\n", child_node, "Object %p, Remaining %X\n", child_node,
acpi_gbl_current_node_count)); acpi_gbl_current_node_count));
/* /* Detach an object if there is one, then free the child node */
* Detach an object if there is one, then free the child node
*/
acpi_ns_detach_object(child_node); acpi_ns_detach_object(child_node);
/* Now we can delete the node */ /* Now we can delete the node */
@ -304,7 +299,6 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
/* Clear the parent's child pointer */ /* Clear the parent's child pointer */
parent_node->child = NULL; parent_node->child = NULL;
return_VOID; return_VOID;
} }

View file

@ -220,9 +220,8 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
acpi_os_printf("%4.4s", acpi_ut_get_node_name(this_node)); acpi_os_printf("%4.4s", acpi_ut_get_node_name(this_node));
} }
/* /* Now we can print out the pertinent information */
* Now we can print out the pertinent information
*/
acpi_os_printf(" %-12s %p %2.2X ", acpi_os_printf(" %-12s %p %2.2X ",
acpi_ut_get_type_name(type), this_node, acpi_ut_get_type_name(type), this_node,
this_node->owner_id); this_node->owner_id);
@ -545,9 +544,8 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
goto cleanup; goto cleanup;
} }
/* /* Valid object, get the pointer to next level, if any */
* Valid object, get the pointer to next level, if any
*/
switch (obj_type) { switch (obj_type) {
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
@ -614,8 +612,8 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
* *
* RETURN: None * RETURN: None
* *
* DESCRIPTION: Dump typed objects within the loaded namespace. * DESCRIPTION: Dump typed objects within the loaded namespace. Uses
* Uses acpi_ns_walk_namespace in conjunction with acpi_ns_dump_one_object. * acpi_ns_walk_namespace in conjunction with acpi_ns_dump_one_object.
* *
******************************************************************************/ ******************************************************************************/

View file

@ -103,7 +103,8 @@ acpi_status acpi_ns_initialize_objects(void)
} }
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"\nInitialized %hd/%hd Regions %hd/%hd Fields %hd/%hd Buffers %hd/%hd Packages (%hd nodes)\n", "\nInitialized %hd/%hd Regions %hd/%hd Fields %hd/%hd "
"Buffers %hd/%hd Packages (%hd nodes)\n",
info.op_region_init, info.op_region_count, info.op_region_init, info.op_region_count,
info.field_init, info.field_count, info.field_init, info.field_count,
info.buffer_init, info.buffer_count, info.buffer_init, info.buffer_count,
@ -148,7 +149,8 @@ acpi_status acpi_ns_initialize_devices(void)
info.num_INI = 0; info.num_INI = 0;
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"Initializing Device/Processor/Thermal objects by executing _INI methods:")); "Initializing Device/Processor/Thermal objects "
"by executing _INI methods:"));
/* Tree analysis: find all subtrees that contain _INI methods */ /* Tree analysis: find all subtrees that contain _INI methods */
@ -180,7 +182,8 @@ acpi_status acpi_ns_initialize_devices(void)
} }
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"\nExecuted %hd _INI methods requiring %hd _STA executions (examined %hd objects)\n", "\nExecuted %hd _INI methods requiring %hd _STA executions "
"(examined %hd objects)\n",
info.num_INI, info.num_STA, info.device_count)); info.num_INI, info.num_STA, info.device_count));
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
@ -263,16 +266,14 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
return (AE_OK); return (AE_OK);
} }
/* /* If the object is already initialized, nothing else to do */
* If the object is already initialized, nothing else to do
*/
if (obj_desc->common.flags & AOPOBJ_DATA_VALID) { if (obj_desc->common.flags & AOPOBJ_DATA_VALID) {
return (AE_OK); return (AE_OK);
} }
/* /* Must lock the interpreter before executing AML code */
* Must lock the interpreter before executing AML code
*/
acpi_ex_enter_interpreter(); acpi_ex_enter_interpreter();
/* /*

View file

@ -128,12 +128,12 @@ acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node)
* parse trees. * parse trees.
*/ */
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"**** Begin Table Method Parsing and Object Initialization ****\n")); "**** Begin Table Method Parsing and Object Initialization\n"));
status = acpi_ds_initialize_objects(table_index, node); status = acpi_ds_initialize_objects(table_index, node);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"**** Completed Table Method Parsing and Object Initialization ****\n")); "**** Completed Table Method Parsing and Object Initialization\n"));
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }

View file

@ -176,9 +176,8 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)
* performs another complete parse of the AML. * performs another complete parse of the AML.
*/ */
ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n")); ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n"));
status = status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1,
acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, table_index, table_index, start_node);
start_node);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
@ -193,9 +192,8 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)
* parse objects are all cached. * parse objects are all cached.
*/ */
ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 2\n")); ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 2\n"));
status = status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2,
acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2, table_index, table_index, start_node);
start_node);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }

View file

@ -302,7 +302,8 @@ acpi_ns_check_parameter_count(char *pathname,
if ((user_param_count != required_params_current) && if ((user_param_count != required_params_current) &&
(user_param_count != required_params_old)) { (user_param_count != required_params_old)) {
ACPI_WARNING((AE_INFO, ACPI_WARNING((AE_INFO,
"%s: Parameter count mismatch - caller passed %d, ACPI requires %d", "%s: Parameter count mismatch - "
"caller passed %d, ACPI requires %d",
pathname, user_param_count, pathname, user_param_count,
required_params_current)); required_params_current));
} }
@ -974,7 +975,8 @@ acpi_ns_check_reference(char *pathname,
} }
ACPI_WARNING((AE_INFO, ACPI_WARNING((AE_INFO,
"%s: Return type mismatch - unexpected reference object type [%s] %2.2X", "%s: Return type mismatch - "
"unexpected reference object type [%s] %2.2X",
pathname, acpi_ut_get_reference_name(return_object), pathname, acpi_ut_get_reference_name(return_object),
return_object->reference.class)); return_object->reference.class));

View file

@ -167,7 +167,8 @@ acpi_ns_search_one_scope(u32 target_name,
/* Searched entire namespace level, not found */ /* Searched entire namespace level, not found */
ACPI_DEBUG_PRINT((ACPI_DB_NAMES, ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
"Name [%4.4s] (%s) not found in search in scope [%4.4s] %p first child %p\n", "Name [%4.4s] (%s) not found in search in scope [%4.4s] "
"%p first child %p\n",
ACPI_CAST_PTR(char, &target_name), ACPI_CAST_PTR(char, &target_name),
acpi_ut_get_type_name(type), acpi_ut_get_type_name(type),
acpi_ut_get_node_name(parent_node), parent_node, acpi_ut_get_node_name(parent_node), parent_node,
@ -239,9 +240,8 @@ acpi_ns_search_parent_tree(u32 target_name,
acpi_ut_get_node_name(parent_node), acpi_ut_get_node_name(parent_node),
ACPI_CAST_PTR(char, &target_name))); ACPI_CAST_PTR(char, &target_name)));
/* /* Search parents until target is found or we have backed up to the root */
* Search parents until target is found or we have backed up to the root
*/
while (parent_node) { while (parent_node) {
/* /*
* Search parent scope. Use TYPE_ANY because we don't care about the * Search parent scope. Use TYPE_ANY because we don't care about the
@ -395,9 +395,9 @@ acpi_ns_search_and_enter(u32 target_name,
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
#ifdef ACPI_ASL_COMPILER #ifdef ACPI_ASL_COMPILER
/*
* Node is an object defined by an External() statement /* Node is an object defined by an External() statement */
*/
if (flags & ACPI_NS_EXTERNAL) { if (flags & ACPI_NS_EXTERNAL) {
new_node->flags |= ANOBJ_IS_EXTERNAL; new_node->flags |= ANOBJ_IS_EXTERNAL;
} }

View file

@ -325,9 +325,8 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info)
next_external_char++; next_external_char++;
} }
} else { } else {
/* /* Handle Carat prefixes */
* Handle Carat prefixes
*/
while (*next_external_char == '^') { while (*next_external_char == '^') {
info->num_carats++; info->num_carats++;
next_external_char++; next_external_char++;
@ -552,9 +551,8 @@ acpi_ns_externalize_name(u32 internal_name_length,
return_ACPI_STATUS(AE_BAD_PARAMETER); return_ACPI_STATUS(AE_BAD_PARAMETER);
} }
/* /* Check for a prefix (one '\' | one or more '^') */
* Check for a prefix (one '\' | one or more '^').
*/
switch (internal_name[0]) { switch (internal_name[0]) {
case '\\': case '\\':
prefix_length = 1; prefix_length = 1;
@ -637,9 +635,8 @@ acpi_ns_externalize_name(u32 internal_name_length,
return_ACPI_STATUS(AE_BAD_PATHNAME); return_ACPI_STATUS(AE_BAD_PATHNAME);
} }
/* /* Build the converted_name */
* Build converted_name
*/
*converted_name = ACPI_ALLOCATE_ZEROED(required_length); *converted_name = ACPI_ALLOCATE_ZEROED(required_length);
if (!(*converted_name)) { if (!(*converted_name)) {
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
@ -685,6 +682,9 @@ acpi_ns_externalize_name(u32 internal_name_length,
* and keep all pointers within this subsystem - however this introduces * and keep all pointers within this subsystem - however this introduces
* more (and perhaps unnecessary) overhead. * more (and perhaps unnecessary) overhead.
* *
* The current implemenation is basically a placeholder until such time comes
* that it is needed.
*
******************************************************************************/ ******************************************************************************/
struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle) struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle)
@ -692,9 +692,8 @@ struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle)
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
/* /* Parameter validation */
* Simple implementation
*/
if ((!handle) || (handle == ACPI_ROOT_OBJECT)) { if ((!handle) || (handle == ACPI_ROOT_OBJECT)) {
return (acpi_gbl_root_node); return (acpi_gbl_root_node);
} }

View file

@ -135,8 +135,8 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct
* starting (and ending) at the node specified by start_handle. * starting (and ending) at the node specified by start_handle.
* The user_function is called whenever a node that matches * The user_function is called whenever a node that matches
* the type parameter is found. If the user function returns * the type parameter is found. If the user function returns
* a non-zero value, the search is terminated immediately and this * a non-zero value, the search is terminated immediately and
* value is returned to the caller. * this value is returned to the caller.
* *
* The point of this procedure is to provide a generic namespace * The point of this procedure is to provide a generic namespace
* walk routine that can be called from multiple places to * walk routine that can be called from multiple places to
@ -200,10 +200,10 @@ acpi_ns_walk_namespace(acpi_object_type type,
/* /*
* Ignore all temporary namespace nodes (created during control * Ignore all temporary namespace nodes (created during control
* method execution) unless told otherwise. These temporary nodes * method execution) unless told otherwise. These temporary nodes
* can cause a race condition because they can be deleted during the * can cause a race condition because they can be deleted during
* execution of the user function (if the namespace is unlocked before * the execution of the user function (if the namespace is
* invocation of the user function.) Only the debugger namespace dump * unlocked before invocation of the user function.) Only the
* will examine the temporary nodes. * debugger namespace dump will examine the temporary nodes.
*/ */
if ((child_node->flags & ANOBJ_TEMPORARY) && if ((child_node->flags & ANOBJ_TEMPORARY) &&
!(flags & ACPI_NS_WALK_TEMP_NODES)) { !(flags & ACPI_NS_WALK_TEMP_NODES)) {