ACK: [PATCH][V2] acpi: method: replace _GPE test by fwts_method_package_elements_type
ivanhu
ivan.hu at canonical.com
Mon Jan 18 06:26:39 UTC 2021
On 1/14/21 2:22 AM, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung at canonical.com>
> ---
> src/acpi/method/method.c | 20 ++++++--------------
> 1 file changed, 6 insertions(+), 14 deletions(-)
>
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index cf994343..a6a06338 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -4669,7 +4669,11 @@ static void method_test_GPE_return(
> {
> FWTS_UNUSED(private);
> FWTS_UNUSED(buf);
> - bool failed = false;
> +
> + static const fwts_package_element elem[] = {
> + { ACPI_TYPE_LOCAL_REFERENCE, "GPE block device" },
> + { ACPI_TYPE_INTEGER, "SCI interrupt" },
> + };
>
> switch (obj->Type) {
> case ACPI_TYPE_INTEGER:
> @@ -4683,19 +4687,7 @@ static void method_test_GPE_return(
> name, (uint64_t)obj->Integer.Value);
> break;
> case ACPI_TYPE_PACKAGE:
> - if (obj->Package.Elements[0].Type != ACPI_TYPE_LOCAL_REFERENCE) {
> - failed = true;
> - fwts_failed(fw, LOG_LEVEL_HIGH, "Method_GPEBadSubPackageReturnType",
> - "%s sub-package element 0 is not a reference.", name);
> - }
> -
> - if (obj->Package.Elements[1].Type != ACPI_TYPE_INTEGER) {
> - failed = true;
> - fwts_failed(fw, LOG_LEVEL_HIGH, "Method_GPEBadSubPackageReturnType",
> - "%s sub-package element 1 is not an integer.", name);
> - }
> -
> - if (!failed)
> + if (fwts_method_package_elements_type(fw, name, "_GPE", obj, elem, FWTS_ARRAY_SIZE(elem)) == FWTS_OK)
> fwts_method_passed_sane(fw, name, "package");
>
> break;
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list