diff options
author | Bob Moore <robert.moore@intel.com> | 2009-12-11 02:26:13 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-12-15 17:29:36 -0500 |
commit | 465da9eb75665203a826f961de74a817b870850a (patch) | |
tree | d59e80cfd871ce3a1e53ec8ef8b49c7563f30f23 | |
parent | 43420bbb892268b5fc42cb80c3bc31dedbad3ac9 (diff) |
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>
-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 e352467413f5..239fa2f731ca 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, | |||
215 | data->node_flags = node->flags; | 215 | data->node_flags = node->flags; |
216 | data->pathname = pathname; | 216 | data->pathname = pathname; |
217 | 217 | ||
218 | /* TBD: For variable-length Packages, remove NULL elements here */ | ||
219 | |||
220 | /* | 218 | /* |
221 | * Check that the type of the return object is what is expected for | 219 | * Check that the type of the main return object is what is expected |
222 | * this predefined name | 220 | * for this predefined name |
223 | */ | 221 | */ |
224 | status = acpi_ns_check_object_type(data, return_object_ptr, | 222 | status = acpi_ns_check_object_type(data, return_object_ptr, |
225 | predefined->info.expected_btypes, | 223 | predefined->info.expected_btypes, |
226 | ACPI_NOT_PACKAGE_ELEMENT); | 224 | ACPI_NOT_PACKAGE_ELEMENT); |
227 | if (ACPI_SUCCESS(status)) { | 225 | if (ACPI_FAILURE(status)) { |
228 | /* | 226 | goto exit; |
229 | * For returned Package objects, check the type of all sub-objects. | 227 | } |
230 | * Note: Package may have been created by call above. | 228 | |
231 | */ | 229 | /* |
232 | if ((*return_object_ptr)->common.type == ACPI_TYPE_PACKAGE) { | 230 | * For returned Package objects, check the type of all sub-objects. |
233 | status = acpi_ns_check_package(data, return_object_ptr); | 231 | * Note: Package may have been newly created by call above. |
232 | */ | ||
233 | if ((*return_object_ptr)->common.type == ACPI_TYPE_PACKAGE) { | ||
234 | |||
235 | /* TBD: For variable-length Packages, remove NULL elements here */ | ||
236 | |||
237 | status = acpi_ns_check_package(data, return_object_ptr); | ||
238 | if (ACPI_FAILURE(status)) { | ||
239 | goto exit; | ||
234 | } | 240 | } |
235 | } | 241 | } |
236 | 242 | ||
237 | /* | 243 | /* |
238 | * Perform additional, more complicated repairs on a per-name | 244 | * The return object was OK, or it was successfully repaired above. |
239 | * basis. Do this regardless of the status from above. | 245 | * Now make some additional checks such as verifying that package |
246 | * objects are sorted correctly (if required) or buffer objects have | ||
247 | * the correct data width (bytes vs. dwords). These repairs are | ||
248 | * performed on a per-name basis, i.e., the code is specific to | ||
249 | * particular predefined names. | ||
240 | */ | 250 | */ |
241 | status = acpi_ns_complex_repairs(data, node, status, return_object_ptr); | 251 | status = acpi_ns_complex_repairs(data, node, status, return_object_ptr); |
242 | 252 | ||
253 | exit: | ||
243 | /* | 254 | /* |
244 | * If the object validation failed or if we successfully repaired one | 255 | * If the object validation failed or if we successfully repaired one |
245 | * or more objects, mark the parent node to suppress further warning | 256 | * or more objects, mark the parent node to suppress further warning |