diff mbox series

[2/2] acpi/method: check _PSC, _SxD and _SxW for max returned integers

Message ID 20200507202603.16333-2-alex.hung@canonical.com
State Accepted
Headers show
Series [1/2] lib: fwts_acpi_object_eval: add a function to check max returned integers | expand

Commit Message

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

Comments

Ivan Hu May 8, 2020, 8:04 a.m. UTC | #1
On 5/8/20 4:26 AM, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 07eec496..254e1519 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -1533,8 +1533,9 @@ static int method_test_PS3(fwts_framework *fw)
>  
>  static int method_test_PSC(fwts_framework *fw)
>  {
> +	uint64_t max = 3;
>  	return method_evaluate_method(fw, METHOD_OPTIONAL,
> -		"_PSC", NULL, 0, fwts_method_test_integer_return, NULL);
> +		"_PSC", NULL, 0, fwts_method_test_integer_max_return, &max);
>  }
>  
>  static int method_test_PSE(fwts_framework *fw)
> @@ -1596,8 +1597,9 @@ static int method_test_PSW(fwts_framework *fw)
>  #define method_test_SxD(name)						\
>  static int method_test ## name(fwts_framework *fw)			\
>  {									\
> +	uint64_t max = 3;						\
>  	return method_evaluate_method(fw, METHOD_OPTIONAL,		\
> -		# name, NULL, 0, fwts_method_test_integer_return, # name);	\
> +		# name, NULL, 0, fwts_method_test_integer_max_return, &max);	\
>  }
>  
>  method_test_SxD(_S1D)
> @@ -1608,8 +1610,9 @@ method_test_SxD(_S4D)
>  #define method_test_SxW(name)						\
>  static int method_test ## name(fwts_framework *fw)			\
>  {									\
> +	uint64_t max = 3;						\
>  	return method_evaluate_method(fw, METHOD_OPTIONAL,		\
> -		# name, NULL, 0, fwts_method_test_integer_return, # name);	\
> +		# name, NULL, 0, fwts_method_test_integer_max_return, &max);	\
>  }
>  
>  method_test_SxW(_S0W)
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
Colin Ian King May 12, 2020, 9:10 a.m. UTC | #2
On 07/05/2020 21:26, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 07eec496..254e1519 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -1533,8 +1533,9 @@ static int method_test_PS3(fwts_framework *fw)
>  
>  static int method_test_PSC(fwts_framework *fw)
>  {
> +	uint64_t max = 3;
>  	return method_evaluate_method(fw, METHOD_OPTIONAL,
> -		"_PSC", NULL, 0, fwts_method_test_integer_return, NULL);
> +		"_PSC", NULL, 0, fwts_method_test_integer_max_return, &max);
>  }
>  
>  static int method_test_PSE(fwts_framework *fw)
> @@ -1596,8 +1597,9 @@ static int method_test_PSW(fwts_framework *fw)
>  #define method_test_SxD(name)						\
>  static int method_test ## name(fwts_framework *fw)			\
>  {									\
> +	uint64_t max = 3;						\
>  	return method_evaluate_method(fw, METHOD_OPTIONAL,		\
> -		# name, NULL, 0, fwts_method_test_integer_return, # name);	\
> +		# name, NULL, 0, fwts_method_test_integer_max_return, &max);	\
>  }
>  
>  method_test_SxD(_S1D)
> @@ -1608,8 +1610,9 @@ method_test_SxD(_S4D)
>  #define method_test_SxW(name)						\
>  static int method_test ## name(fwts_framework *fw)			\
>  {									\
> +	uint64_t max = 3;						\
>  	return method_evaluate_method(fw, METHOD_OPTIONAL,		\
> -		# name, NULL, 0, fwts_method_test_integer_return, # name);	\
> +		# name, NULL, 0, fwts_method_test_integer_max_return, &max);	\
>  }
>  
>  method_test_SxW(_S0W)
> 

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 07eec496..254e1519 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -1533,8 +1533,9 @@  static int method_test_PS3(fwts_framework *fw)
 
 static int method_test_PSC(fwts_framework *fw)
 {
+	uint64_t max = 3;
 	return method_evaluate_method(fw, METHOD_OPTIONAL,
-		"_PSC", NULL, 0, fwts_method_test_integer_return, NULL);
+		"_PSC", NULL, 0, fwts_method_test_integer_max_return, &max);
 }
 
 static int method_test_PSE(fwts_framework *fw)
@@ -1596,8 +1597,9 @@  static int method_test_PSW(fwts_framework *fw)
 #define method_test_SxD(name)						\
 static int method_test ## name(fwts_framework *fw)			\
 {									\
+	uint64_t max = 3;						\
 	return method_evaluate_method(fw, METHOD_OPTIONAL,		\
-		# name, NULL, 0, fwts_method_test_integer_return, # name);	\
+		# name, NULL, 0, fwts_method_test_integer_max_return, &max);	\
 }
 
 method_test_SxD(_S1D)
@@ -1608,8 +1610,9 @@  method_test_SxD(_S4D)
 #define method_test_SxW(name)						\
 static int method_test ## name(fwts_framework *fw)			\
 {									\
+	uint64_t max = 3;						\
 	return method_evaluate_method(fw, METHOD_OPTIONAL,		\
-		# name, NULL, 0, fwts_method_test_integer_return, # name);	\
+		# name, NULL, 0, fwts_method_test_integer_max_return, &max);	\
 }
 
 method_test_SxW(_S0W)