ACPICA: Update names for walk_namespace callbacks to clarify usage.
Use of "preorder" and "postorder" was incorrect. The callbacks are simply invoked during tree ascent and descent during the depth-first walk. 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:
parent
a50abf4842
commit
4ef1750783
@ -104,8 +104,8 @@ acpi_ns_walk_namespace(acpi_object_type type,
|
|||||||
acpi_handle start_object,
|
acpi_handle start_object,
|
||||||
u32 max_depth,
|
u32 max_depth,
|
||||||
u32 flags,
|
u32 flags,
|
||||||
acpi_walk_callback pre_order_visit,
|
acpi_walk_callback descending_callback,
|
||||||
acpi_walk_callback post_order_visit,
|
acpi_walk_callback ascending_callback,
|
||||||
void *context, void **return_value);
|
void *context, void **return_value);
|
||||||
|
|
||||||
struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node
|
struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node
|
||||||
|
@ -156,9 +156,9 @@ struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type,
|
|||||||
* max_depth - Depth to which search is to reach
|
* max_depth - Depth to which search is to reach
|
||||||
* flags - Whether to unlock the NS before invoking
|
* flags - Whether to unlock the NS before invoking
|
||||||
* the callback routine
|
* the callback routine
|
||||||
* pre_order_visit - Called during tree pre-order visit
|
* descending_callback - Called during tree descent
|
||||||
* when an object of "Type" is found
|
* when an object of "Type" is found
|
||||||
* post_order_visit - Called during tree post-order visit
|
* ascending_callback - Called during tree ascent
|
||||||
* when an object of "Type" is found
|
* when an object of "Type" is found
|
||||||
* context - Passed to user function(s) above
|
* context - Passed to user function(s) above
|
||||||
* return_value - from the user_function if terminated
|
* return_value - from the user_function if terminated
|
||||||
@ -185,8 +185,8 @@ acpi_ns_walk_namespace(acpi_object_type type,
|
|||||||
acpi_handle start_node,
|
acpi_handle start_node,
|
||||||
u32 max_depth,
|
u32 max_depth,
|
||||||
u32 flags,
|
u32 flags,
|
||||||
acpi_walk_callback pre_order_visit,
|
acpi_walk_callback descending_callback,
|
||||||
acpi_walk_callback post_order_visit,
|
acpi_walk_callback ascending_callback,
|
||||||
void *context, void **return_value)
|
void *context, void **return_value)
|
||||||
{
|
{
|
||||||
acpi_status status;
|
acpi_status status;
|
||||||
@ -255,21 +255,21 @@ acpi_ns_walk_namespace(acpi_object_type type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Invoke the user function, either pre-order or post-order
|
* Invoke the user function, either descending, ascending,
|
||||||
* or both.
|
* or both.
|
||||||
*/
|
*/
|
||||||
if (!node_previously_visited) {
|
if (!node_previously_visited) {
|
||||||
if (pre_order_visit) {
|
if (descending_callback) {
|
||||||
status =
|
status =
|
||||||
pre_order_visit(child_node, level,
|
descending_callback(child_node,
|
||||||
context,
|
level, context,
|
||||||
return_value);
|
return_value);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (post_order_visit) {
|
if (ascending_callback) {
|
||||||
status =
|
status =
|
||||||
post_order_visit(child_node, level,
|
ascending_callback(child_node,
|
||||||
context,
|
level, context,
|
||||||
return_value);
|
return_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -533,9 +533,9 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info)
|
|||||||
* PARAMETERS: type - acpi_object_type to search for
|
* PARAMETERS: type - acpi_object_type to search for
|
||||||
* start_object - Handle in namespace where search begins
|
* start_object - Handle in namespace where search begins
|
||||||
* max_depth - Depth to which search is to reach
|
* max_depth - Depth to which search is to reach
|
||||||
* pre_order_visit - Called during tree pre-order visit
|
* descending_callback - Called during tree descent
|
||||||
* when an object of "Type" is found
|
* when an object of "Type" is found
|
||||||
* post_order_visit - Called during tree post-order visit
|
* ascending_callback - Called during tree ascent
|
||||||
* when an object of "Type" is found
|
* when an object of "Type" is found
|
||||||
* context - Passed to user function(s) above
|
* context - Passed to user function(s) above
|
||||||
* return_value - Location where return value of
|
* return_value - Location where return value of
|
||||||
@ -563,8 +563,8 @@ acpi_status
|
|||||||
acpi_walk_namespace(acpi_object_type type,
|
acpi_walk_namespace(acpi_object_type type,
|
||||||
acpi_handle start_object,
|
acpi_handle start_object,
|
||||||
u32 max_depth,
|
u32 max_depth,
|
||||||
acpi_walk_callback pre_order_visit,
|
acpi_walk_callback descending_callback,
|
||||||
acpi_walk_callback post_order_visit,
|
acpi_walk_callback ascending_callback,
|
||||||
void *context, void **return_value)
|
void *context, void **return_value)
|
||||||
{
|
{
|
||||||
acpi_status status;
|
acpi_status status;
|
||||||
@ -574,7 +574,7 @@ acpi_walk_namespace(acpi_object_type type,
|
|||||||
/* Parameter validation */
|
/* Parameter validation */
|
||||||
|
|
||||||
if ((type > ACPI_TYPE_LOCAL_MAX) ||
|
if ((type > ACPI_TYPE_LOCAL_MAX) ||
|
||||||
(!max_depth) || (!pre_order_visit && !post_order_visit)) {
|
(!max_depth) || (!descending_callback && !ascending_callback)) {
|
||||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,9 +606,9 @@ acpi_walk_namespace(acpi_object_type type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = acpi_ns_walk_namespace(type, start_object, max_depth,
|
status = acpi_ns_walk_namespace(type, start_object, max_depth,
|
||||||
ACPI_NS_WALK_UNLOCK, pre_order_visit,
|
ACPI_NS_WALK_UNLOCK,
|
||||||
post_order_visit, context,
|
descending_callback, ascending_callback,
|
||||||
return_value);
|
context, return_value);
|
||||||
|
|
||||||
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
|
||||||
|
|
||||||
|
@ -212,8 +212,8 @@ acpi_status
|
|||||||
acpi_walk_namespace(acpi_object_type type,
|
acpi_walk_namespace(acpi_object_type type,
|
||||||
acpi_handle start_object,
|
acpi_handle start_object,
|
||||||
u32 max_depth,
|
u32 max_depth,
|
||||||
acpi_walk_callback pre_order_visit,
|
acpi_walk_callback descending_callback,
|
||||||
acpi_walk_callback post_order_visit,
|
acpi_walk_callback ascending_callback,
|
||||||
void *context, void **return_value);
|
void *context, void **return_value);
|
||||||
|
|
||||||
acpi_status
|
acpi_status
|
||||||
|
Loading…
Reference in New Issue
Block a user