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

Colin Ian King colin.king at canonical.com
Tue Jan 26 20:39:33 UTC 2021


On 26/01/2021 20:32, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung at 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;
> 




More information about the fwts-devel mailing list