diff mbox series

acpi/method: reuse common function for _PCL method

Message ID 20200505002910.175759-1-alex.hung@canonical.com
State Accepted
Headers show
Series acpi/method: reuse common function for _PCL method | expand

Commit Message

Alex Hung May 5, 2020, 12:29 a.m. UTC
This is a refactor and there are no functional changes

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

Comments

Colin Ian King May 5, 2020, 9:38 a.m. UTC | #1
On 05/05/2020 01:29, Alex Hung wrote:
> This is a refactor and there are no functional changes
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 23 +----------------------
>  1 file changed, 1 insertion(+), 22 deletions(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index b166fb73..230717e5 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -4377,31 +4377,10 @@ static int method_test_BTP(fwts_framework *fw)
>  	return FWTS_OK;
>  }
>  
> -static void method_test_PCL_return(fwts_framework *fw,
> -	char *name,
> -	ACPI_BUFFER *buf,
> -	ACPI_OBJECT *obj,
> -	void *private)
> -{
> -	FWTS_UNUSED(fw);
> -	FWTS_UNUSED(name);
> -	FWTS_UNUSED(buf);
> -	FWTS_UNUSED(obj);
> -	FWTS_UNUSED(private);
> -
> -	if (fwts_method_check_type(fw, name, buf, ACPI_TYPE_PACKAGE) != FWTS_OK)
> -		return;
> -
> -	if (fwts_method_package_elements_all_type(fw, name, "_PCL", obj, ACPI_TYPE_LOCAL_REFERENCE) != FWTS_OK)
> -		return;
> -
> -	fwts_passed(fw,	"%s returned a sane package of %" PRIu32 " references.", name, obj->Package.Count);
> -}
> -
>  static int method_test_PCL(fwts_framework *fw)
>  {
>  	return method_evaluate_method(fw, METHOD_MOBILE,
> -		"_PCL", NULL, 0, method_test_PCL_return, "_PCL");
> +		"_PCL", NULL, 0, fwts_method_test_all_reference_package_return, "_PCL");
>  }
>  
>  static int method_test_BTH(fwts_framework *fw)
> 

Acked-by: Colin Ian King <colin.king@canonical.com>
Ivan Hu May 8, 2020, 7:50 a.m. UTC | #2
On 5/5/20 8:29 AM, Alex Hung wrote:
> This is a refactor and there are no functional changes
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 23 +----------------------
>  1 file changed, 1 insertion(+), 22 deletions(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index b166fb73..230717e5 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -4377,31 +4377,10 @@ static int method_test_BTP(fwts_framework *fw)
>  	return FWTS_OK;
>  }
>  
> -static void method_test_PCL_return(fwts_framework *fw,
> -	char *name,
> -	ACPI_BUFFER *buf,
> -	ACPI_OBJECT *obj,
> -	void *private)
> -{
> -	FWTS_UNUSED(fw);
> -	FWTS_UNUSED(name);
> -	FWTS_UNUSED(buf);
> -	FWTS_UNUSED(obj);
> -	FWTS_UNUSED(private);
> -
> -	if (fwts_method_check_type(fw, name, buf, ACPI_TYPE_PACKAGE) != FWTS_OK)
> -		return;
> -
> -	if (fwts_method_package_elements_all_type(fw, name, "_PCL", obj, ACPI_TYPE_LOCAL_REFERENCE) != FWTS_OK)
> -		return;
> -
> -	fwts_passed(fw,	"%s returned a sane package of %" PRIu32 " references.", name, obj->Package.Count);
> -}
> -
>  static int method_test_PCL(fwts_framework *fw)
>  {
>  	return method_evaluate_method(fw, METHOD_MOBILE,
> -		"_PCL", NULL, 0, method_test_PCL_return, "_PCL");
> +		"_PCL", NULL, 0, fwts_method_test_all_reference_package_return, "_PCL");
>  }
>  
>  static int method_test_BTH(fwts_framework *fw)
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index b166fb73..230717e5 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -4377,31 +4377,10 @@  static int method_test_BTP(fwts_framework *fw)
 	return FWTS_OK;
 }
 
-static void method_test_PCL_return(fwts_framework *fw,
-	char *name,
-	ACPI_BUFFER *buf,
-	ACPI_OBJECT *obj,
-	void *private)
-{
-	FWTS_UNUSED(fw);
-	FWTS_UNUSED(name);
-	FWTS_UNUSED(buf);
-	FWTS_UNUSED(obj);
-	FWTS_UNUSED(private);
-
-	if (fwts_method_check_type(fw, name, buf, ACPI_TYPE_PACKAGE) != FWTS_OK)
-		return;
-
-	if (fwts_method_package_elements_all_type(fw, name, "_PCL", obj, ACPI_TYPE_LOCAL_REFERENCE) != FWTS_OK)
-		return;
-
-	fwts_passed(fw,	"%s returned a sane package of %" PRIu32 " references.", name, obj->Package.Count);
-}
-
 static int method_test_PCL(fwts_framework *fw)
 {
 	return method_evaluate_method(fw, METHOD_MOBILE,
-		"_PCL", NULL, 0, method_test_PCL_return, "_PCL");
+		"_PCL", NULL, 0, fwts_method_test_all_reference_package_return, "_PCL");
 }
 
 static int method_test_BTH(fwts_framework *fw)