aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/nsrepair.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/nsrepair.c')
-rw-r--r--drivers/acpi/acpica/nsrepair.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/drivers/acpi/acpica/nsrepair.c b/drivers/acpi/acpica/nsrepair.c
index 18f02e4ece01..f8e71ea60319 100644
--- a/drivers/acpi/acpica/nsrepair.c
+++ b/drivers/acpi/acpica/nsrepair.c
@@ -130,7 +130,7 @@ static const struct acpi_simple_repair_info acpi_object_repair_info[] = {
130 * 130 *
131 * FUNCTION: acpi_ns_simple_repair 131 * FUNCTION: acpi_ns_simple_repair
132 * 132 *
133 * PARAMETERS: data - Pointer to validation data structure 133 * PARAMETERS: info - Method execution information block
134 * expected_btypes - Object types expected 134 * expected_btypes - Object types expected
135 * package_index - Index of object within parent package (if 135 * package_index - Index of object within parent package (if
136 * applicable - ACPI_NOT_PACKAGE_ELEMENT 136 * applicable - ACPI_NOT_PACKAGE_ELEMENT
@@ -146,7 +146,7 @@ static const struct acpi_simple_repair_info acpi_object_repair_info[] = {
146 ******************************************************************************/ 146 ******************************************************************************/
147 147
148acpi_status 148acpi_status
149acpi_ns_simple_repair(struct acpi_predefined_data *data, 149acpi_ns_simple_repair(struct acpi_evaluate_info *info,
150 u32 expected_btypes, 150 u32 expected_btypes,
151 u32 package_index, 151 u32 package_index,
152 union acpi_operand_object **return_object_ptr) 152 union acpi_operand_object **return_object_ptr)
@@ -162,12 +162,12 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
162 * Special repairs for certain names that are in the repair table. 162 * Special repairs for certain names that are in the repair table.
163 * Check if this name is in the list of repairable names. 163 * Check if this name is in the list of repairable names.
164 */ 164 */
165 predefined = acpi_ns_match_simple_repair(data->node, 165 predefined = acpi_ns_match_simple_repair(info->node,
166 data->return_btype, 166 info->return_btype,
167 package_index); 167 package_index);
168 if (predefined) { 168 if (predefined) {
169 if (!return_object) { 169 if (!return_object) {
170 ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, 170 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
171 ACPI_WARN_ALWAYS, 171 ACPI_WARN_ALWAYS,
172 "Missing expected return value")); 172 "Missing expected return value"));
173 } 173 }
@@ -191,7 +191,7 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
191 * Do not perform simple object repair unless the return type is not 191 * Do not perform simple object repair unless the return type is not
192 * expected. 192 * expected.
193 */ 193 */
194 if (data->return_btype & expected_btypes) { 194 if (info->return_btype & expected_btypes) {
195 return (AE_OK); 195 return (AE_OK);
196 } 196 }
197 197
@@ -211,7 +211,7 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
211 */ 211 */
212 if (!return_object) { 212 if (!return_object) {
213 if (expected_btypes && (!(expected_btypes & ACPI_RTYPE_NONE))) { 213 if (expected_btypes && (!(expected_btypes & ACPI_RTYPE_NONE))) {
214 ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, 214 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
215 ACPI_WARN_ALWAYS, 215 ACPI_WARN_ALWAYS,
216 "Missing expected return value")); 216 "Missing expected return value"));
217 217
@@ -247,14 +247,14 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
247 * for correct contents (expected object type or types). 247 * for correct contents (expected object type or types).
248 */ 248 */
249 status = 249 status =
250 acpi_ns_wrap_with_package(data, return_object, &new_object); 250 acpi_ns_wrap_with_package(info, return_object, &new_object);
251 if (ACPI_SUCCESS(status)) { 251 if (ACPI_SUCCESS(status)) {
252 /* 252 /*
253 * The original object just had its reference count 253 * The original object just had its reference count
254 * incremented for being inserted into the new package. 254 * incremented for being inserted into the new package.
255 */ 255 */
256 *return_object_ptr = new_object; /* New Package object */ 256 *return_object_ptr = new_object; /* New Package object */
257 data->flags |= ACPI_OBJECT_REPAIRED; 257 info->return_flags |= ACPI_OBJECT_REPAIRED;
258 return (AE_OK); 258 return (AE_OK);
259 } 259 }
260 } 260 }
@@ -277,7 +277,7 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
277 * package object as part of the repair, we don't need to 277 * package object as part of the repair, we don't need to
278 * change the reference count. 278 * change the reference count.
279 */ 279 */
280 if (!(data->flags & ACPI_OBJECT_WRAPPED)) { 280 if (!(info->return_flags & ACPI_OBJECT_WRAPPED)) {
281 new_object->common.reference_count = 281 new_object->common.reference_count =
282 return_object->common.reference_count; 282 return_object->common.reference_count;
283 283
@@ -288,14 +288,14 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
288 288
289 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR, 289 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
290 "%s: Converted %s to expected %s at Package index %u\n", 290 "%s: Converted %s to expected %s at Package index %u\n",
291 data->pathname, 291 info->full_pathname,
292 acpi_ut_get_object_type_name(return_object), 292 acpi_ut_get_object_type_name(return_object),
293 acpi_ut_get_object_type_name(new_object), 293 acpi_ut_get_object_type_name(new_object),
294 package_index)); 294 package_index));
295 } else { 295 } else {
296 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR, 296 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
297 "%s: Converted %s to expected %s\n", 297 "%s: Converted %s to expected %s\n",
298 data->pathname, 298 info->full_pathname,
299 acpi_ut_get_object_type_name(return_object), 299 acpi_ut_get_object_type_name(return_object),
300 acpi_ut_get_object_type_name(new_object))); 300 acpi_ut_get_object_type_name(new_object)));
301 } 301 }
@@ -304,7 +304,7 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
304 304
305 acpi_ut_remove_reference(return_object); 305 acpi_ut_remove_reference(return_object);
306 *return_object_ptr = new_object; 306 *return_object_ptr = new_object;
307 data->flags |= ACPI_OBJECT_REPAIRED; 307 info->return_flags |= ACPI_OBJECT_REPAIRED;
308 return (AE_OK); 308 return (AE_OK);
309} 309}
310 310
@@ -359,7 +359,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct
359 * 359 *
360 * FUNCTION: acpi_ns_repair_null_element 360 * FUNCTION: acpi_ns_repair_null_element
361 * 361 *
362 * PARAMETERS: data - Pointer to validation data structure 362 * PARAMETERS: info - Method execution information block
363 * expected_btypes - Object types expected 363 * expected_btypes - Object types expected
364 * package_index - Index of object within parent package (if 364 * package_index - Index of object within parent package (if
365 * applicable - ACPI_NOT_PACKAGE_ELEMENT 365 * applicable - ACPI_NOT_PACKAGE_ELEMENT
@@ -374,7 +374,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct
374 ******************************************************************************/ 374 ******************************************************************************/
375 375
376acpi_status 376acpi_status
377acpi_ns_repair_null_element(struct acpi_predefined_data *data, 377acpi_ns_repair_null_element(struct acpi_evaluate_info * info,
378 u32 expected_btypes, 378 u32 expected_btypes,
379 u32 package_index, 379 u32 package_index,
380 union acpi_operand_object **return_object_ptr) 380 union acpi_operand_object **return_object_ptr)
@@ -424,16 +424,16 @@ acpi_ns_repair_null_element(struct acpi_predefined_data *data,
424 /* Set the reference count according to the parent Package object */ 424 /* Set the reference count according to the parent Package object */
425 425
426 new_object->common.reference_count = 426 new_object->common.reference_count =
427 data->parent_package->common.reference_count; 427 info->parent_package->common.reference_count;
428 428
429 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR, 429 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
430 "%s: Converted NULL package element to expected %s at index %u\n", 430 "%s: Converted NULL package element to expected %s at index %u\n",
431 data->pathname, 431 info->full_pathname,
432 acpi_ut_get_object_type_name(new_object), 432 acpi_ut_get_object_type_name(new_object),
433 package_index)); 433 package_index));
434 434
435 *return_object_ptr = new_object; 435 *return_object_ptr = new_object;
436 data->flags |= ACPI_OBJECT_REPAIRED; 436 info->return_flags |= ACPI_OBJECT_REPAIRED;
437 return (AE_OK); 437 return (AE_OK);
438} 438}
439 439
@@ -441,7 +441,7 @@ acpi_ns_repair_null_element(struct acpi_predefined_data *data,
441 * 441 *
442 * FUNCTION: acpi_ns_remove_null_elements 442 * FUNCTION: acpi_ns_remove_null_elements
443 * 443 *
444 * PARAMETERS: data - Pointer to validation data structure 444 * PARAMETERS: info - Method execution information block
445 * package_type - An acpi_return_package_types value 445 * package_type - An acpi_return_package_types value
446 * obj_desc - A Package object 446 * obj_desc - A Package object
447 * 447 *
@@ -454,7 +454,7 @@ acpi_ns_repair_null_element(struct acpi_predefined_data *data,
454 *****************************************************************************/ 454 *****************************************************************************/
455 455
456void 456void
457acpi_ns_remove_null_elements(struct acpi_predefined_data *data, 457acpi_ns_remove_null_elements(struct acpi_evaluate_info *info,
458 u8 package_type, 458 u8 package_type,
459 union acpi_operand_object *obj_desc) 459 union acpi_operand_object *obj_desc)
460{ 460{
@@ -480,6 +480,7 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
480 case ACPI_PTYPE2_MIN: 480 case ACPI_PTYPE2_MIN:
481 case ACPI_PTYPE2_REV_FIXED: 481 case ACPI_PTYPE2_REV_FIXED:
482 case ACPI_PTYPE2_FIX_VAR: 482 case ACPI_PTYPE2_FIX_VAR:
483
483 break; 484 break;
484 485
485 default: 486 default:
@@ -511,7 +512,7 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
511 if (new_count < count) { 512 if (new_count < count) {
512 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR, 513 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
513 "%s: Found and removed %u NULL elements\n", 514 "%s: Found and removed %u NULL elements\n",
514 data->pathname, (count - new_count))); 515 info->full_pathname, (count - new_count)));
515 516
516 /* NULL terminate list and update the package count */ 517 /* NULL terminate list and update the package count */
517 518
@@ -524,7 +525,7 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
524 * 525 *
525 * FUNCTION: acpi_ns_wrap_with_package 526 * FUNCTION: acpi_ns_wrap_with_package
526 * 527 *
527 * PARAMETERS: data - Pointer to validation data structure 528 * PARAMETERS: info - Method execution information block
528 * original_object - Pointer to the object to repair. 529 * original_object - Pointer to the object to repair.
529 * obj_desc_ptr - The new package object is returned here 530 * obj_desc_ptr - The new package object is returned here
530 * 531 *
@@ -545,7 +546,7 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
545 ******************************************************************************/ 546 ******************************************************************************/
546 547
547acpi_status 548acpi_status
548acpi_ns_wrap_with_package(struct acpi_predefined_data *data, 549acpi_ns_wrap_with_package(struct acpi_evaluate_info *info,
549 union acpi_operand_object *original_object, 550 union acpi_operand_object *original_object,
550 union acpi_operand_object **obj_desc_ptr) 551 union acpi_operand_object **obj_desc_ptr)
551{ 552{
@@ -566,12 +567,12 @@ acpi_ns_wrap_with_package(struct acpi_predefined_data *data,
566 567
567 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR, 568 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
568 "%s: Wrapped %s with expected Package object\n", 569 "%s: Wrapped %s with expected Package object\n",
569 data->pathname, 570 info->full_pathname,
570 acpi_ut_get_object_type_name(original_object))); 571 acpi_ut_get_object_type_name(original_object)));
571 572
572 /* Return the new object in the object pointer */ 573 /* Return the new object in the object pointer */
573 574
574 *obj_desc_ptr = pkg_obj_desc; 575 *obj_desc_ptr = pkg_obj_desc;
575 data->flags |= ACPI_OBJECT_REPAIRED | ACPI_OBJECT_WRAPPED; 576 info->return_flags |= ACPI_OBJECT_REPAIRED | ACPI_OBJECT_WRAPPED;
576 return (AE_OK); 577 return (AE_OK);
577} 578}