diff options
author | Bob Moore <robert.moore@intel.com> | 2009-12-11 07:26:13 (GMT) |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-12-15 22:29:36 (GMT) |
commit | 465da9eb75665203a826f961de74a817b870850a (patch) | |
tree | d59e80cfd871ce3a1e53ec8ef8b49c7563f30f23 /drivers/acpi/acpica | |
parent | 43420bbb892268b5fc42cb80c3bc31dedbad3ac9 (diff) | |
download | linux-465da9eb75665203a826f961de74a817b870850a.tar.xz |
ACPICA: Conditionally perform complex per-predefined-name repairs
Only attempt the "complex" repairs (package sorting, buffer
expansion) if the previous "generic" validation and repair was
successful.
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>
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r-- | drivers/acpi/acpica/nspredef.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c index e352467..239fa2f 100644 --- a/drivers/acpi/acpica/nspredef.c +++ b/drivers/acpi/acpica/nspredef.c @@ -215,31 +215,42 @@ acpi_ns_check_predefined_names(struct acpi_namespace_node *node, data->node_flags = node->flags; data->pathname = pathname; - /* TBD: For variable-length Packages, remove NULL elements here */ - /* - * Check that the type of the return object is what is expected for - * this predefined name + * Check that the type of the main return object is what is expected + * for this predefined name */ status = acpi_ns_check_object_type(data, return_object_ptr, predefined->info.expected_btypes, ACPI_NOT_PACKAGE_ELEMENT); - if (ACPI_SUCCESS(status)) { - /* - * For returned Package objects, check the type of all sub-objects. - * Note: Package may have been created by call above. - */ - if ((*return_object_ptr)->common.type == ACPI_TYPE_PACKAGE) { - status = acpi_ns_check_package(data, return_object_ptr); + if (ACPI_FAILURE(status)) { + goto exit; + } + + /* + * For returned Package objects, check the type of all sub-objects. + * Note: Package may have been newly created by call above. + */ + if ((*return_object_ptr)->common.type == ACPI_TYPE_PACKAGE) { + + /* TBD: For variable-length Packages, remove NULL elements here */ + + status = acpi_ns_check_package(data, return_object_ptr); + if (ACPI_FAILURE(status)) { + goto exit; } } /* - * Perform additional, more complicated repairs on a per-name - * basis. Do this regardless of the status from above. + * The return object was OK, or it was successfully repaired above. + * Now make some additional checks such as verifying that package + * objects are sorted correctly (if required) or buffer objects have + * the correct data width (bytes vs. dwords). These repairs are + * performed on a per-name basis, i.e., the code is specific to + * particular predefined names. */ status = acpi_ns_complex_repairs(data, node, status, return_object_ptr); +exit: /* * If the object validation failed or if we successfully repaired one * or more objects, mark the parent node to suppress further warning |