Patchwork [02/26] lib: fwts_acpi_method: fix for loop index type

login
register
mail settings
Submitter Colin King
Date Oct. 14, 2012, 8:31 p.m.
Message ID <1350246738-31699-3-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/191395/
State Accepted
Headers show

Comments

Colin King - Oct. 14, 2012, 8:31 p.m.
From: Colin Ian King <colin.king@canonical.com>

Fix the type of a for loop to match that of the package Count type

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_acpi_method.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Alex Hung - Oct. 15, 2012, 2:44 a.m.
On 10/15/2012 04:31 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Fix the type of a for loop to match that of the package Count type
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/src/fwts_acpi_method.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib/src/fwts_acpi_method.c b/src/lib/src/fwts_acpi_method.c
> index 4a0e7ec..7974545 100644
> --- a/src/lib/src/fwts_acpi_method.c
> +++ b/src/lib/src/fwts_acpi_method.c
> @@ -182,7 +182,7 @@ char *fwts_method_exists(char *name)
>    */
>   static void fwts_method_dump_object_recursive(fwts_framework *fw, ACPI_OBJECT *obj, int depth, int index)
>   {
> -	int i;
> +	uint32_t i;
>   	char index_buf[5];
>
>   	if (index > -1)
> @@ -206,7 +206,7 @@ static void fwts_method_dump_object_recursive(fwts_framework *fw, ACPI_OBJECT *o
>   	case ACPI_TYPE_PACKAGE:
>   		fwts_log_info_verbatum(fw, "%*s%sPackage has %d elements:",depth * 2, "",
>   			index_buf, obj->Package.Count);
> -		for (i=0; i < obj->Package.Count; i++) {
> +		for (i = 0; i < obj->Package.Count; i++) {
>   			ACPI_OBJECT *element = &obj->Package.Elements[i];
>   			fwts_method_dump_object_recursive(fw, element, depth + 1, i);
>   		}
>

Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - Oct. 17, 2012, 7:38 a.m.
On Mon, Oct 15, 2012 at 4:31 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Fix the type of a for loop to match that of the package Count type
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_acpi_method.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib/src/fwts_acpi_method.c b/src/lib/src/fwts_acpi_method.c
> index 4a0e7ec..7974545 100644
> --- a/src/lib/src/fwts_acpi_method.c
> +++ b/src/lib/src/fwts_acpi_method.c
> @@ -182,7 +182,7 @@ char *fwts_method_exists(char *name)
>   */
>  static void fwts_method_dump_object_recursive(fwts_framework *fw, ACPI_OBJECT *obj, int depth, int index)
>  {
> -       int i;
> +       uint32_t i;
>         char index_buf[5];
>
>         if (index > -1)
> @@ -206,7 +206,7 @@ static void fwts_method_dump_object_recursive(fwts_framework *fw, ACPI_OBJECT *o
>         case ACPI_TYPE_PACKAGE:
>                 fwts_log_info_verbatum(fw, "%*s%sPackage has %d elements:",depth * 2, "",
>                         index_buf, obj->Package.Count);
> -               for (i=0; i < obj->Package.Count; i++) {
> +               for (i = 0; i < obj->Package.Count; i++) {
>                         ACPI_OBJECT *element = &obj->Package.Elements[i];
>                         fwts_method_dump_object_recursive(fw, element, depth + 1, i);
>                 }
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/lib/src/fwts_acpi_method.c b/src/lib/src/fwts_acpi_method.c
index 4a0e7ec..7974545 100644
--- a/src/lib/src/fwts_acpi_method.c
+++ b/src/lib/src/fwts_acpi_method.c
@@ -182,7 +182,7 @@  char *fwts_method_exists(char *name)
  */
 static void fwts_method_dump_object_recursive(fwts_framework *fw, ACPI_OBJECT *obj, int depth, int index)
 {
-	int i;
+	uint32_t i;
 	char index_buf[5];
 
 	if (index > -1)
@@ -206,7 +206,7 @@  static void fwts_method_dump_object_recursive(fwts_framework *fw, ACPI_OBJECT *o
 	case ACPI_TYPE_PACKAGE:
 		fwts_log_info_verbatum(fw, "%*s%sPackage has %d elements:",depth * 2, "",
 			index_buf, obj->Package.Count);
-		for (i=0; i < obj->Package.Count; i++) {
+		for (i = 0; i < obj->Package.Count; i++) {
 			ACPI_OBJECT *element = &obj->Package.Elements[i];
 			fwts_method_dump_object_recursive(fw, element, depth + 1, i);
 		}