aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/parser/pstree.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/parser/pstree.c')
-rw-r--r--drivers/acpi/parser/pstree.c92
1 files changed, 30 insertions, 62 deletions
diff --git a/drivers/acpi/parser/pstree.c b/drivers/acpi/parser/pstree.c
index d5aafe73fca..f0e755884ee 100644
--- a/drivers/acpi/parser/pstree.c
+++ b/drivers/acpi/parser/pstree.c
@@ -41,23 +41,18 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <acpi/acpi.h>
#include <acpi/acparser.h>
#include <acpi/amlcode.h>
#define _COMPONENT ACPI_PARSER
- ACPI_MODULE_NAME ("pstree")
+ACPI_MODULE_NAME("pstree")
/* Local prototypes */
-
#ifdef ACPI_OBSOLETE_FUNCTIONS
-union acpi_parse_object *
-acpi_ps_get_child (
- union acpi_parse_object *op);
+union acpi_parse_object *acpi_ps_get_child(union acpi_parse_object *op);
#endif
-
/*******************************************************************************
*
* FUNCTION: acpi_ps_get_arg
@@ -71,21 +66,16 @@ acpi_ps_get_child (
*
******************************************************************************/
-union acpi_parse_object *
-acpi_ps_get_arg (
- union acpi_parse_object *op,
- u32 argn)
+union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn)
{
- union acpi_parse_object *arg = NULL;
- const struct acpi_opcode_info *op_info;
-
-
- ACPI_FUNCTION_ENTRY ();
+ union acpi_parse_object *arg = NULL;
+ const struct acpi_opcode_info *op_info;
+ ACPI_FUNCTION_ENTRY();
/* Get the info structure for this opcode */
- op_info = acpi_ps_get_opcode_info (op->common.aml_opcode);
+ op_info = acpi_ps_get_opcode_info(op->common.aml_opcode);
if (op_info->class == AML_CLASS_UNKNOWN) {
/* Invalid opcode or ASCII character */
@@ -111,7 +101,6 @@ acpi_ps_get_arg (
return (arg);
}
-
/*******************************************************************************
*
* FUNCTION: acpi_ps_append_arg
@@ -126,16 +115,12 @@ acpi_ps_get_arg (
******************************************************************************/
void
-acpi_ps_append_arg (
- union acpi_parse_object *op,
- union acpi_parse_object *arg)
+acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg)
{
- union acpi_parse_object *prev_arg;
- const struct acpi_opcode_info *op_info;
-
-
- ACPI_FUNCTION_ENTRY ();
+ union acpi_parse_object *prev_arg;
+ const struct acpi_opcode_info *op_info;
+ ACPI_FUNCTION_ENTRY();
if (!op) {
return;
@@ -143,12 +128,11 @@ acpi_ps_append_arg (
/* Get the info structure for this opcode */
- op_info = acpi_ps_get_opcode_info (op->common.aml_opcode);
+ op_info = acpi_ps_get_opcode_info(op->common.aml_opcode);
if (op_info->class == AML_CLASS_UNKNOWN) {
/* Invalid opcode */
- ACPI_REPORT_ERROR (("ps_append_arg: Invalid AML Opcode: 0x%2.2X\n",
- op->common.aml_opcode));
+ ACPI_REPORT_ERROR(("ps_append_arg: Invalid AML Opcode: 0x%2.2X\n", op->common.aml_opcode));
return;
}
@@ -170,8 +154,7 @@ acpi_ps_append_arg (
prev_arg = prev_arg->common.next;
}
prev_arg->common.next = arg;
- }
- else {
+ } else {
/* No argument list, this will be the first argument */
op->common.value.arg = arg;
@@ -185,7 +168,6 @@ acpi_ps_append_arg (
}
}
-
#ifdef ACPI_FUTURE_USAGE
/*******************************************************************************
*
@@ -201,18 +183,14 @@ acpi_ps_append_arg (
*
******************************************************************************/
-union acpi_parse_object *
-acpi_ps_get_depth_next (
- union acpi_parse_object *origin,
- union acpi_parse_object *op)
+union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin,
+ union acpi_parse_object *op)
{
- union acpi_parse_object *next = NULL;
- union acpi_parse_object *parent;
- union acpi_parse_object *arg;
-
-
- ACPI_FUNCTION_ENTRY ();
+ union acpi_parse_object *next = NULL;
+ union acpi_parse_object *parent;
+ union acpi_parse_object *arg;
+ ACPI_FUNCTION_ENTRY();
if (!op) {
return (NULL);
@@ -220,7 +198,7 @@ acpi_ps_get_depth_next (
/* Look for an argument or child */
- next = acpi_ps_get_arg (op, 0);
+ next = acpi_ps_get_arg(op, 0);
if (next) {
return (next);
}
@@ -237,7 +215,7 @@ acpi_ps_get_depth_next (
parent = op->common.parent;
while (parent) {
- arg = acpi_ps_get_arg (parent, 0);
+ arg = acpi_ps_get_arg(parent, 0);
while (arg && (arg != origin) && (arg != op)) {
arg = arg->common.next;
}
@@ -261,7 +239,6 @@ acpi_ps_get_depth_next (
return (next);
}
-
#ifdef ACPI_OBSOLETE_FUNCTIONS
/*******************************************************************************
*
@@ -275,15 +252,11 @@ acpi_ps_get_depth_next (
*
******************************************************************************/
-union acpi_parse_object *
-acpi_ps_get_child (
- union acpi_parse_object *op)
+union acpi_parse_object *acpi_ps_get_child(union acpi_parse_object *op)
{
- union acpi_parse_object *child = NULL;
-
-
- ACPI_FUNCTION_ENTRY ();
+ union acpi_parse_object *child = NULL;
+ ACPI_FUNCTION_ENTRY();
switch (op->common.aml_opcode) {
case AML_SCOPE_OP:
@@ -292,10 +265,9 @@ acpi_ps_get_child (
case AML_THERMAL_ZONE_OP:
case AML_INT_METHODCALL_OP:
- child = acpi_ps_get_arg (op, 0);
+ child = acpi_ps_get_arg(op, 0);
break;
-
case AML_BUFFER_OP:
case AML_PACKAGE_OP:
case AML_METHOD_OP:
@@ -303,24 +275,21 @@ acpi_ps_get_child (
case AML_WHILE_OP:
case AML_FIELD_OP:
- child = acpi_ps_get_arg (op, 1);
+ child = acpi_ps_get_arg(op, 1);
break;
-
case AML_POWER_RES_OP:
case AML_INDEX_FIELD_OP:
- child = acpi_ps_get_arg (op, 2);
+ child = acpi_ps_get_arg(op, 2);
break;
-
case AML_PROCESSOR_OP:
case AML_BANK_FIELD_OP:
- child = acpi_ps_get_arg (op, 3);
+ child = acpi_ps_get_arg(op, 3);
break;
-
default:
/* All others have no children */
break;
@@ -330,5 +299,4 @@ acpi_ps_get_child (
}
#endif
-#endif /* ACPI_FUTURE_USAGE */
-
+#endif /* ACPI_FUTURE_USAGE */