X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Facpi%2Fparser%2Fpswalk.c;h=06f05bfd761262c6f1776b25b3329b65b958c1b5;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=110d2ce917b643a92f44b0f2967d04871bd23582;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/drivers/acpi/parser/pswalk.c b/drivers/acpi/parser/pswalk.c index 110d2ce91..06f05bfd7 100644 --- a/drivers/acpi/parser/pswalk.c +++ b/drivers/acpi/parser/pswalk.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,13 +41,11 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include #include #define _COMPONENT ACPI_PARSER - ACPI_MODULE_NAME ("pswalk") - +ACPI_MODULE_NAME("pswalk") /******************************************************************************* * @@ -60,18 +58,13 @@ * DESCRIPTION: Delete a portion of or an entire parse tree. * ******************************************************************************/ - -void -acpi_ps_delete_parse_tree ( - union acpi_parse_object *subtree_root) +void acpi_ps_delete_parse_tree(union acpi_parse_object *subtree_root) { - union acpi_parse_object *op = subtree_root; - union acpi_parse_object *next = NULL; - union acpi_parse_object *parent = NULL; - - - ACPI_FUNCTION_TRACE_PTR ("ps_delete_parse_tree", subtree_root); + union acpi_parse_object *op = subtree_root; + union acpi_parse_object *next = NULL; + union acpi_parse_object *parent = NULL; + ACPI_FUNCTION_TRACE_PTR("ps_delete_parse_tree", subtree_root); /* Visit all nodes in the subtree */ @@ -81,7 +74,7 @@ acpi_ps_delete_parse_tree ( if (op != parent) { /* Look for an argument or child of the current op */ - next = acpi_ps_get_arg (op, 0); + next = acpi_ps_get_arg(op, 0); if (next) { /* Still going downward in tree (Op is not completed yet) */ @@ -90,26 +83,24 @@ acpi_ps_delete_parse_tree ( } } - /* - * No more children, this Op is complete. - */ + /* No more children, this Op is complete. */ + next = op->common.next; parent = op->common.parent; - acpi_ps_free_op (op); + acpi_ps_free_op(op); + + /* If we are back to the starting point, the walk is complete. */ - /* - * If we are back to the starting point, the walk is complete. - */ if (op == subtree_root) { return_VOID; } if (next) { op = next; - } - else { + } else { op = parent; } } + return_VOID; }