aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/nsrepair2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/nsrepair2.c')
-rw-r--r--drivers/acpi/acpica/nsrepair2.c84
1 files changed, 0 insertions, 84 deletions
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index 29ff5d14e1d..61bd0f6755d 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -45,7 +45,6 @@
45#include <acpi/acpi.h> 45#include <acpi/acpi.h>
46#include "accommon.h" 46#include "accommon.h"
47#include "acnamesp.h" 47#include "acnamesp.h"
48#include "acpredef.h"
49 48
50#define _COMPONENT ACPI_NAMESPACE 49#define _COMPONENT ACPI_NAMESPACE
51ACPI_MODULE_NAME("nsrepair2") 50ACPI_MODULE_NAME("nsrepair2")
@@ -520,89 +519,6 @@ acpi_ns_check_sorted_list(struct acpi_predefined_data *data,
520 519
521/****************************************************************************** 520/******************************************************************************
522 * 521 *
523 * FUNCTION: acpi_ns_remove_null_elements
524 *
525 * PARAMETERS: Data - Pointer to validation data structure
526 * package_type - An acpi_return_package_types value
527 * obj_desc - A Package object
528 *
529 * RETURN: None.
530 *
531 * DESCRIPTION: Remove all NULL package elements from packages that contain
532 * a variable number of sub-packages.
533 *
534 *****************************************************************************/
535
536void
537acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
538 u8 package_type,
539 union acpi_operand_object *obj_desc)
540{
541 union acpi_operand_object **source;
542 union acpi_operand_object **dest;
543 u32 count;
544 u32 new_count;
545 u32 i;
546
547 ACPI_FUNCTION_NAME(ns_remove_null_elements);
548
549 /*
550 * PTYPE1 packages contain no subpackages.
551 * PTYPE2 packages contain a variable number of sub-packages. We can
552 * safely remove all NULL elements from the PTYPE2 packages.
553 */
554 switch (package_type) {
555 case ACPI_PTYPE1_FIXED:
556 case ACPI_PTYPE1_VAR:
557 case ACPI_PTYPE1_OPTION:
558 return;
559
560 case ACPI_PTYPE2:
561 case ACPI_PTYPE2_COUNT:
562 case ACPI_PTYPE2_PKG_COUNT:
563 case ACPI_PTYPE2_FIXED:
564 case ACPI_PTYPE2_MIN:
565 case ACPI_PTYPE2_REV_FIXED:
566 break;
567
568 default:
569 return;
570 }
571
572 count = obj_desc->package.count;
573 new_count = count;
574
575 source = obj_desc->package.elements;
576 dest = source;
577
578 /* Examine all elements of the package object, remove nulls */
579
580 for (i = 0; i < count; i++) {
581 if (!*source) {
582 new_count--;
583 } else {
584 *dest = *source;
585 dest++;
586 }
587 source++;
588 }
589
590 /* Update parent package if any null elements were removed */
591
592 if (new_count < count) {
593 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
594 "%s: Found and removed %u NULL elements\n",
595 data->pathname, (count - new_count)));
596
597 /* NULL terminate list and update the package count */
598
599 *dest = NULL;
600 obj_desc->package.count = new_count;
601 }
602}
603
604/******************************************************************************
605 *
606 * FUNCTION: acpi_ns_sort_list 522 * FUNCTION: acpi_ns_sort_list
607 * 523 *
608 * PARAMETERS: Elements - Package object element list 524 * PARAMETERS: Elements - Package object element list