[PATCH] acpi: method: fix some tests that don't indicate passed when they are complete

Colin King colin.king at canonical.com
Thu Jan 10 11:42:19 UTC 2013


From: Colin Ian King <colin.king at canonical.com>

Update some ACPI method tests that don't show that they have passed when they
have completed.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/acpi/method/method.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index 3864e88..baf9c36 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -900,6 +900,7 @@ static void method_test_PLD_return(
 	void *private)
 {
 	uint32_t i;
+	bool failed = false;
 
 	FWTS_UNUSED(private);
 
@@ -914,9 +915,13 @@ static void method_test_PLD_return(
 				"%s package element %" PRIu32 " was not a buffer.",
 				name, i);
 			fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
+			failed = true;
 		}
 		/* We should sanity check the PLD further */
 	}
+
+	if (!failed)
+		method_passed_sane(fw, name, "package");
 }
 
 static int method_test_PLD(fwts_framework *fw)
@@ -1851,6 +1856,7 @@ static void method_test_EDL_return(
 	void *private)
 {
 	uint32_t i;
+	bool failed = false;
 
 	FWTS_UNUSED(private);
 
@@ -1865,8 +1871,12 @@ static void method_test_EDL_return(
 				"%s package element %" PRIu32 " was not a reference.",
 				name, i);
 			fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
+			failed = true;
 		}
 	}
+
+	if (!failed)
+		method_passed_sane(fw, name, "package");
 }
 
 static int method_test_EDL(fwts_framework *fw)
@@ -2092,6 +2102,7 @@ static void method_test_power_resources_return(
 	void *private)
 {
 	uint32_t i;
+	bool failed = false;
 
 	FWTS_UNUSED(private);
 
@@ -2106,8 +2117,12 @@ static void method_test_power_resources_return(
 				"%s package element %" PRIu32 " was not a reference.",
 				name, i);
 			fwts_tag_failed(fw, FWTS_TAG_ACPI_METHOD_RETURN);
+			failed = true;
 		}
 	}
+
+	if (!failed)
+		method_passed_sane(fw, name, "package");
 }
 
 #define method_test_POWER(name)						\
@@ -3267,6 +3282,7 @@ static void method_test_GRT_return(
 	 * Should sanity check this, but we can't read the
 	 * the data in this emulated mode, so ignore
 	 */
+	method_passed_sane(fw, name, "buffer");
 }
 
 static int method_test_GRT(fwts_framework *fw)
@@ -3895,6 +3911,8 @@ static void method_test_BMD_return(
 		}
 	}
 	/* TODO: check return values */
+	if (!failed)
+		method_passed_sane(fw, name, "package");
 }
 
 static int method_test_BMD(fwts_framework *fw)
@@ -4527,7 +4545,8 @@ static void method_test_ROM_return(
 	FWTS_UNUSED(obj);
 	FWTS_UNUSED(private);
 
-	method_check_type(fw, name, buf, ACPI_TYPE_BUFFER);
+	if (method_check_type(fw, name, buf, ACPI_TYPE_BUFFER) == FWTS_OK)
+		method_passed_sane(fw, name, "package");
 }
 
 static int method_test_ROM(fwts_framework *fw)
-- 
1.8.0




More information about the fwts-devel mailing list