public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: get_throttling_state() cannot be larger state_count
@ 2009-02-11 19:50 Roel Kluin
  2009-02-12  2:35 ` yakui_zhao
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-02-11 19:50 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, Andrew Morton

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;
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ACPI: get_throttling_state() cannot be larger state_count
  2009-02-11 19:50 [PATCH] ACPI: get_throttling_state() cannot be larger state_count Roel Kluin
@ 2009-02-12  2:35 ` yakui_zhao
  0 siblings, 0 replies; 2+ messages in thread
From: yakui_zhao @ 2009-02-12  2:35 UTC (permalink / raw)
  To: Roel Kluin; +Cc: lenb@kernel.org, linux-acpi@vger.kernel.org, Andrew Morton

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-12  2:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-11 19:50 [PATCH] ACPI: get_throttling_state() cannot be larger state_count Roel Kluin
2009-02-12  2:35 ` yakui_zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox