[PATCH] method: replace duplicated code by util function in _PRR test

Alex Hung alex.hung at canonical.com
Fri May 15 21:36:16 UTC 2020


Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
 src/acpi/method/method.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index b7e9177c..11e230ea 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -1609,13 +1609,8 @@ static void method_test_PRR_return(
 	if (fwts_method_package_count_equal(fw, name, "_PRR", obj, 1) != FWTS_OK)
 		return;
 
-	if (obj->Package.Elements[0].Type != ACPI_TYPE_LOCAL_REFERENCE) {
-		fwts_failed(fw, LOG_LEVEL_MEDIUM,
-			"Method_PRRElementType",
-			"%s returned a package that does not contain "
-			"a reference.", name);
+	if (fwts_method_package_elements_all_type(fw, name, "_PRR", obj, ACPI_TYPE_LOCAL_REFERENCE) != FWTS_OK)
 		return;
-	}
 
 	fwts_method_passed_sane(fw, name, "package");
 }
-- 
2.25.1




More information about the fwts-devel mailing list