Patchwork acpi: method: _CST test checks for wrong number of package elements

login
register
mail settings
Submitter Colin King
Date Jan. 8, 2013, 7:52 p.m.
Message ID <1357674767-29828-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/210487/
State Accepted
Headers show

Comments

Colin King - Jan. 8, 2013, 7:52 p.m.
From: Colin Ian King <colin.king@canonical.com>

After running this through some of the various tables in my collection
I discovered that the _CST test checks for the number of elements
incorrectly.  This fixes an off-by-one error.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/method/method.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Keng-Yu Lin - Jan. 23, 2013, 7:22 a.m.
On Wed, Jan 9, 2013 at 3:52 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> After running this through some of the various tables in my collection
> I discovered that the _CST test checks for the number of elements
> incorrectly.  This fixes an off-by-one error.
>
> Signed-off-by: Colin Ian King <colin.king@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 2ac3155..fd7aac0 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -2423,7 +2423,7 @@ static void method_test_CST_return(
>                 return;
>
>         /* _CST has at least two elements */
> -       if (obj->Package.Count < 3) {
> +       if (obj->Package.Count < 2) {
>                 fwts_failed(fw, LOG_LEVEL_MEDIUM, "Method_CSTElementCount",
>                         "%s should return package of at least 2 elements, "
>                         "got %" PRIu32 " elements instead.",
> --
> 1.8.0
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - Jan. 31, 2013, 7:32 a.m.
On 01/09/2013 03:52 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> After running this through some of the various tables in my collection
> I discovered that the _CST test checks for the number of elements
> incorrectly.  This fixes an off-by-one error.
>
> Signed-off-by: Colin Ian King <colin.king@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 2ac3155..fd7aac0 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -2423,7 +2423,7 @@ static void method_test_CST_return(
>   		return;
>
>   	/* _CST has at least two elements */
> -	if (obj->Package.Count < 3) {
> +	if (obj->Package.Count < 2) {
>   		fwts_failed(fw, LOG_LEVEL_MEDIUM, "Method_CSTElementCount",
>   			"%s should return package of at least 2 elements, "
>   			"got %" PRIu32 " elements instead.",
>
Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index 2ac3155..fd7aac0 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -2423,7 +2423,7 @@  static void method_test_CST_return(
 		return;
 
 	/* _CST has at least two elements */
-	if (obj->Package.Count < 3) {
+	if (obj->Package.Count < 2) {
 		fwts_failed(fw, LOG_LEVEL_MEDIUM, "Method_CSTElementCount",
 			"%s should return package of at least 2 elements, "
 			"got %" PRIu32 " elements instead.",