Message ID | 20200515213616.1086689-1-alex.hung@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | method: replace duplicated code by util function in _PRR test | expand |
On 15/05/2020 22:36, Alex Hung wrote: > Signed-off-by: Alex Hung <alex.hung@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"); > } > Acked-by: Colin Ian King <colin.king@canonical.com>
On 5/16/20 5:36 AM, Alex Hung wrote: > Signed-off-by: Alex Hung <alex.hung@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"); > } > Acked-by: Ivan Hu <ivan.hu@canonical.com>
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"); }
Signed-off-by: Alex Hung <alex.hung@canonical.com> --- src/acpi/method/method.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)