diff mbox series

[5/7] acpi: method: refine _Sx count checks by fwts_method_package_count_min

Message ID 20210123021231.54136-5-alex.hung@canonical.com
State Accepted
Headers show
Series [1/7] acpi: method: refine _PSS and _TSS method tests | expand

Commit Message

Alex Hung Jan. 23, 2021, 2:12 a.m. UTC
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/acpi/method/method.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Ivan Hu Jan. 25, 2021, 3:18 a.m. UTC | #1
On 1/23/21 10:12 AM, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 61204f92..b9f463c8 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -1610,14 +1610,8 @@ static void method_test_Sx__return(
>   	 */
>  
>  	/* Something is really wrong if we don't have any elements in _Sx_ */
> -	if (obj->Package.Count < 1) {
> -		fwts_failed(fw, LOG_LEVEL_HIGH, "Method_SxElementCount",
> -			"The kernel expects a package of at least two "
> -			"integers, and %s only returned %" PRIu32
> -			" elements in the package.",
> -			name, obj->Package.Count);
> +	if (fwts_method_package_count_min(fw, name, obj, 1) != FWTS_OK)
>  		return;
> -	}
>  
>  	/*
>  	 * Oh dear, BIOS is conforming to the spec but won't work in
> 


Acked-by: Ivan Hu <ivan.hu@canonical.com>
Colin Ian King Jan. 26, 2021, 6:02 p.m. UTC | #2
On 23/01/2021 02:12, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 61204f92..b9f463c8 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -1610,14 +1610,8 @@ static void method_test_Sx__return(
>   	 */
>  
>  	/* Something is really wrong if we don't have any elements in _Sx_ */
> -	if (obj->Package.Count < 1) {
> -		fwts_failed(fw, LOG_LEVEL_HIGH, "Method_SxElementCount",
> -			"The kernel expects a package of at least two "
> -			"integers, and %s only returned %" PRIu32
> -			" elements in the package.",
> -			name, obj->Package.Count);
> +	if (fwts_method_package_count_min(fw, name, obj, 1) != FWTS_OK)
>  		return;
> -	}
>  
>  	/*
>  	 * Oh dear, BIOS is conforming to the spec but won't work in
> 

Acked-by: Colin Ian King <colin.king@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index 61204f92..b9f463c8 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -1610,14 +1610,8 @@  static void method_test_Sx__return(
  	 */
 
 	/* Something is really wrong if we don't have any elements in _Sx_ */
-	if (obj->Package.Count < 1) {
-		fwts_failed(fw, LOG_LEVEL_HIGH, "Method_SxElementCount",
-			"The kernel expects a package of at least two "
-			"integers, and %s only returned %" PRIu32
-			" elements in the package.",
-			name, obj->Package.Count);
+	if (fwts_method_package_count_min(fw, name, obj, 1) != FWTS_OK)
 		return;
-	}
 
 	/*
 	 * Oh dear, BIOS is conforming to the spec but won't work in