diff mbox

ACPI: get_throttling_state() cannot be larger state_count

Message ID 49932BF4.2010005@gmail.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Roel Kluin Feb. 11, 2009, 7:50 p.m. UTC
With for(i = 0; i < n; i++) { ... } i reaches n.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Zhao, Yakui Feb. 12, 2009, 2:35 a.m. UTC | #1
On Thu, 2009-02-12 at 03:50 +0800, Roel Kluin wrote:
   In fact the function of acpi_get_throttling_state will be used only
when the _PTC(throttling object) exists. The status argument will be
compared with the _TSS package. In theory it will be found in the _TSS
package and the corresponding T-state will be obtained. 

But from the program logic it will be OK.

acked-by: <yakui.zhao@intel.com>

Thanks.    
> With for(i = 0; i < n; i++) { ... } i reaches n.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
> index d278381..6feb9ab 100644
> --- a/drivers/acpi/processor_throttling.c
> +++ b/drivers/acpi/processor_throttling.c
> @@ -785,7 +785,7 @@ static int acpi_get_throttling_state(struct acpi_processor *pr,
>  		if (tx->control == value)
>  			break;
>  	}
> -	if (i > pr->throttling.state_count)
> +	if (i >= pr->throttling.state_count)
>  		i = -1;
>  	return i;
>  }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index d278381..6feb9ab 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -785,7 +785,7 @@  static int acpi_get_throttling_state(struct acpi_processor *pr,
 		if (tx->control == value)
 			break;
 	}
-	if (i > pr->throttling.state_count)
+	if (i >= pr->throttling.state_count)
 		i = -1;
 	return i;
 }