[PATCH 15/16] ACPICA: _CST repair: Handle null package entries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sort package only after null/bad elements have been removed.
Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@xxxxxxxxx>
Signed-off-by: Bob Moore <robert.moore@xxxxxxxxx>
---
 drivers/acpi/acpica/nsrepair2.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index 029816e..c84603e 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -452,18 +452,7 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info,
 	ACPI_FUNCTION_NAME(ns_repair_CST);
 
 	/*
-	 * Entries (subpackages) in the _CST Package must be sorted by the
-	 * C-state type, in ascending order.
-	 */
-	status = acpi_ns_check_sorted_list(info, return_object, 1, 4, 1,
-					   ACPI_SORT_ASCENDING, "C-State Type");
-	if (ACPI_FAILURE(status)) {
-		return (status);
-	}
-
-	/*
-	 * We now know the list is correctly sorted by C-state type. Check if
-	 * the C-state type values are proportional.
+	 * Check if the C-state type values are proportional.
 	 */
 	outer_element_count = return_object->package.count - 1;
 	i = 0;
@@ -502,6 +491,17 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info,
 
 	obj_desc = return_object->package.elements[0];
 	obj_desc->integer.value = outer_element_count;
+
+	/*
+	 * Entries (subpackages) in the _CST Package must be sorted by the
+	 * C-state type, in ascending order.
+	 */
+	status = acpi_ns_check_sorted_list(info, return_object, 1, 4, 1,
+					   ACPI_SORT_ASCENDING, "C-State Type");
+	if (ACPI_FAILURE(status)) {
+		return (status);
+	}
+
 	return (AE_OK);
 }
 
-- 
1.7.10

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux