diff mbox series

[15/16] acpi: method: update _DDC argument size (mantis 2137)

Message ID 20210126203227.6291-1-alex.hung@canonical.com
State Superseded
Headers show
Series [01/16] acpi: update ACPI version to 6.4 | expand

Commit Message

Alex Hung Jan. 26, 2021, 8:32 p.m. UTC
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/acpi/method/method.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Colin Ian King Jan. 26, 2021, 8:39 p.m. UTC | #1
On 26/01/2021 20:32, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 8ef5da5e..78c9de54 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -4562,16 +4562,17 @@ static void method_test_DDC_return(
>  
>  static int method_test_DDC(fwts_framework *fw)
>  {
> +	int values[] = { 128, 256, 384, 512 };

Could values be static or static const?

>  	ACPI_OBJECT arg[1];
>  	uint32_t i;
>  
> -	for (i = 128; i <= 256; i <<= 1) {
> +	for (i = 0; i < FWTS_ARRAY_SIZE(values); i++) {
>  		arg[0].Type = ACPI_TYPE_INTEGER;
> -		arg[0].Integer.Value = 128;
> +		arg[0].Integer.Value = values[i];
>  
>  		if (method_evaluate_method(fw, METHOD_OPTIONAL,
>  			"_DDC", arg, 1, method_test_DDC_return,
> -			&i) == FWTS_NOT_EXIST)
> +			(void *) &values[i]) == FWTS_NOT_EXIST)
>  			break;
>  	}
>  	return FWTS_OK;
>
diff mbox series

Patch

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index 8ef5da5e..78c9de54 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -4562,16 +4562,17 @@  static void method_test_DDC_return(
 
 static int method_test_DDC(fwts_framework *fw)
 {
+	int values[] = { 128, 256, 384, 512 };
 	ACPI_OBJECT arg[1];
 	uint32_t i;
 
-	for (i = 128; i <= 256; i <<= 1) {
+	for (i = 0; i < FWTS_ARRAY_SIZE(values); i++) {
 		arg[0].Type = ACPI_TYPE_INTEGER;
-		arg[0].Integer.Value = 128;
+		arg[0].Integer.Value = values[i];
 
 		if (method_evaluate_method(fw, METHOD_OPTIONAL,
 			"_DDC", arg, 1, method_test_DDC_return,
-			&i) == FWTS_NOT_EXIST)
+			(void *) &values[i]) == FWTS_NOT_EXIST)
 			break;
 	}
 	return FWTS_OK;