diff options
author | Patrick Georgi <patrick@georgi-clan.de> | 2015-08-25 12:24:49 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-08-26 12:20:08 +0000 |
commit | 4eb8abeb8570f2dca688f4e2a22697c756404ab2 (patch) | |
tree | b3420f173f2ff7763810b1ede44b2649db23755a /util/cbfstool/cbfs_image.c | |
parent | 64fc433a567011238a4c1ee886445173a5d8ae56 (diff) | |
download | coreboot-4eb8abeb8570f2dca688f4e2a22697c756404ab2.tar.xz |
cbfstool: more descriptive variable name
"target", for what? It's the offset where the file header of the currently
added file will be located, name it as such.
Change-Id: I382f08f81991faf660e217566849773d9a7ec227
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11319
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'util/cbfstool/cbfs_image.c')
-rw-r--r-- | util/cbfstool/cbfs_image.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c index 7d6239ac86..0fb780d4bd 100644 --- a/util/cbfstool/cbfs_image.c +++ b/util/cbfstool/cbfs_image.c @@ -466,22 +466,22 @@ static int cbfs_add_entry_at(struct cbfs_image *image, uint32_t addr = cbfs_get_entry_addr(image, entry), addr_next = cbfs_get_entry_addr(image, next); uint32_t min_entry_size = cbfs_calculate_file_header_size(""); - uint32_t len, target; + uint32_t len, header_offset; uint32_t align = image->has_header ? image->header.align : CBFS_ENTRY_ALIGNMENT; - target = content_offset - header_size; - if (target % align) - target -= target % align; - if (target < addr) { + header_offset = content_offset - header_size; + if (header_offset % align) + header_offset -= header_offset % align; + if (header_offset < addr) { ERROR("No space to hold cbfs_file header."); return -1; } // Process buffer BEFORE content_offset. - if (target - addr > min_entry_size) { + if (header_offset - addr > min_entry_size) { DEBUG("|min|...|header|content|... <create new entry>\n"); - len = target - addr - min_entry_size; + len = header_offset - addr - min_entry_size; cbfs_create_empty_entry(entry, CBFS_COMPONENT_NULL, len, ""); if (verbose > 1) cbfs_print_entry_info(image, entry, stderr); entry = cbfs_find_next_entry(image, entry); |