[coreboot-gerrit] Patch set updated for coreboot: a0aa2b8 cbfstool: Fix shadowed global index
Kyösti Mälkki (kyosti.malkki@gmail.com)
gerrit at coreboot.org
Fri May 15 17:41:27 CEST 2015
Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10210
-gerrit
commit a0aa2b86566a89eb8c5eb78e8327b491e7198ef7
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date: Fri May 15 09:14:09 2015 +0300
cbfstool: Fix shadowed global index
Change-Id: Ic8bccea1f2ddef874d8e440fa4fa05de1d4f9550
Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
util/cbfstool/cbfstool.c | 10 +++++-----
util/cbfstool/partitioned_file.c | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index fd0ff35..68a83e7 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -500,8 +500,8 @@ static int cbfs_layout(void)
printf("This image contains the following sections that can be %s with this tool:\n",
param.show_immutable ? "accessed" : "manipulated");
puts("");
- for (unsigned index = 0; index < fmap->nareas; ++index) {
- const struct fmap_area *current = fmap->areas + index;
+ for (unsigned i = 0; i < fmap->nareas; ++i) {
+ const struct fmap_area *current = fmap->areas + i;
bool readonly = partitioned_file_fmap_count(param.image_file,
partitioned_file_fmap_select_children_of, current) ||
@@ -520,10 +520,10 @@ static int cbfs_layout(void)
// of tree that had duplicate lists in addition to child lists,
// which would allow covering that weird, unlikely case as well.
unsigned lookahead;
- for (lookahead = 1; index + lookahead < fmap->nareas;
+ for (lookahead = 1; i + lookahead < fmap->nareas;
++lookahead) {
const struct fmap_area *consecutive =
- fmap->areas + index + lookahead;
+ fmap->areas + i + lookahead;
if (consecutive->offset != current->offset ||
consecutive->size != current->size)
break;
@@ -539,7 +539,7 @@ static int cbfs_layout(void)
qualifier = "CBFS, ";
printf(" (%ssize %u)\n", qualifier, current->size);
- index += lookahead - 1;
+ i += lookahead - 1;
}
puts("");
diff --git a/util/cbfstool/partitioned_file.c b/util/cbfstool/partitioned_file.c
index 3f47a26..4e1a8b5 100644
--- a/util/cbfstool/partitioned_file.c
+++ b/util/cbfstool/partitioned_file.c
@@ -46,8 +46,8 @@ static unsigned count_selected_fmap_entries(const struct fmap *fmap,
assert(callback);
unsigned count = 0;
- for (unsigned index = 0; index < fmap->nareas; ++index) {
- if (callback(fmap->areas + index, arg))
+ for (unsigned i = 0; i < fmap->nareas; ++i) {
+ if (callback(fmap->areas + i, arg))
++count;
}
return count;
More information about the coreboot-gerrit
mailing list