[coreboot-gerrit] New patch to review for coreboot: 48d576f cbfstool: Don't use declaration inside for.

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Mon May 25 17:40:30 CEST 2015


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10291

-gerrit

commit 48d576fdc8d9acc90dd289d97d524ba1fce22f3a
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Mon May 25 17:39:53 2015 +0200

    cbfstool: Don't use declaration inside for.
    
    Bad syntax and triggers wanings/errors.
    
    Change-Id: I064f1d2616d1461f8f75986280bc51662a42eee7
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 util/cbfstool/fmd_parser.c_shipped | 3 ++-
 util/cbfstool/fmd_parser.y         | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/util/cbfstool/fmd_parser.c_shipped b/util/cbfstool/fmd_parser.c_shipped
index d463393..2e35e6f 100644
--- a/util/cbfstool/fmd_parser.c_shipped
+++ b/util/cbfstool/fmd_parser.c_shipped
@@ -1629,7 +1629,8 @@ struct flashmap_descriptor *parse_descriptor(char *name,
 			return NULL;
 		}
 		struct descriptor_node *cur_node = children.head;
-		for (unsigned idx = 0; idx < region->list_len; ++idx) {
+		unsigned idx = 0;
+		for (idx = 0; idx < region->list_len; ++idx) {
 			region->list[idx] = cur_node->val;
 
 			struct descriptor_node *next_node = cur_node->next;
diff --git a/util/cbfstool/fmd_parser.y b/util/cbfstool/fmd_parser.y
index caa2beb..d969d91 100644
--- a/util/cbfstool/fmd_parser.y
+++ b/util/cbfstool/fmd_parser.y
@@ -172,7 +172,8 @@ struct flashmap_descriptor *parse_descriptor(char *name,
 			return NULL;
 		}
 		struct descriptor_node *cur_node = children.head;
-		for (unsigned idx = 0; idx < region->list_len; ++idx) {
+		unsigned idx = 0;
+		for (idx = 0; idx < region->list_len; ++idx) {
 			region->list[idx] = cur_node->val;
 
 			struct descriptor_node *next_node = cur_node->next;



More information about the coreboot-gerrit mailing list