diff mbox series

acpi/method: fix _SxW which can return 4

Message ID 20201105000114.69601-1-alex.hung@canonical.com
State Accepted
Headers show
Series acpi/method: fix _SxW which can return 4 | expand

Commit Message

Alex Hung Nov. 5, 2020, 12:01 a.m. UTC
ACPI spec allows _SxW to return 4 for D3cold as the following:

"If it has indicated _PR3 support, the value "3" represents D3hot and
the value "4" represents D3cold."

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

Comments

Ivan Hu Nov. 9, 2020, 1:53 a.m. UTC | #1
On 11/5/20 8:01 AM, Alex Hung wrote:
> ACPI spec allows _SxW to return 4 for D3cold as the following:
> 
> "If it has indicated _PR3 support, the value "3" represents D3hot and
> the value "4" represents D3cold."
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index c4939087..b857913c 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -1583,7 +1583,7 @@ method_test_SxD(_S4D)
>  #define method_test_SxW(name)						\
>  static int method_test ## name(fwts_framework *fw)			\
>  {									\
> -	uint64_t max = 3;						\
> +	uint64_t max = 4;						\
>  	return method_evaluate_method(fw, METHOD_OPTIONAL,		\
>  		# name, NULL, 0, fwts_method_test_integer_max_return, &max);	\
>  }
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
Colin Ian King Nov. 23, 2020, 9:18 a.m. UTC | #2
On 05/11/2020 00:01, Alex Hung wrote:
> ACPI spec allows _SxW to return 4 for D3cold as the following:
> 
> "If it has indicated _PR3 support, the value "3" represents D3hot and
> the value "4" represents D3cold."
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index c4939087..b857913c 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -1583,7 +1583,7 @@ method_test_SxD(_S4D)
>  #define method_test_SxW(name)						\
>  static int method_test ## name(fwts_framework *fw)			\
>  {									\
> -	uint64_t max = 3;						\
> +	uint64_t max = 4;						\
>  	return method_evaluate_method(fw, METHOD_OPTIONAL,		\
>  		# name, NULL, 0, fwts_method_test_integer_max_return, &max);	\
>  }
>

It may be a good idea to change these magic values into a #define value
one day to add a bit more meaning.

Acked-by: Colin Ian King <colin.king@canonical.com>
Colin Ian King Nov. 23, 2020, 9:19 a.m. UTC | #3
On 05/11/2020 00:01, Alex Hung wrote:
> ACPI spec allows _SxW to return 4 for D3cold as the following:
> 
> "If it has indicated _PR3 support, the value "3" represents D3hot and
> the value "4" represents D3cold."
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index c4939087..b857913c 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -1583,7 +1583,7 @@ method_test_SxD(_S4D)
>  #define method_test_SxW(name)						\
>  static int method_test ## name(fwts_framework *fw)			\
>  {									\
> -	uint64_t max = 3;						\
> +	uint64_t max = 4;						\
>  	return method_evaluate_method(fw, METHOD_OPTIONAL,		\
>  		# name, NULL, 0, fwts_method_test_integer_max_return, &max);	\
>  }
> 

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 c4939087..b857913c 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -1583,7 +1583,7 @@  method_test_SxD(_S4D)
 #define method_test_SxW(name)						\
 static int method_test ## name(fwts_framework *fw)			\
 {									\
-	uint64_t max = 3;						\
+	uint64_t max = 4;						\
 	return method_evaluate_method(fw, METHOD_OPTIONAL,		\
 		# name, NULL, 0, fwts_method_test_integer_max_return, &max);	\
 }