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>
This commit is contained in:
Patrick Georgi 2015-08-25 12:24:49 +02:00 committed by Patrick Georgi
parent 64fc433a56
commit 4eb8abeb85
1 changed files with 7 additions and 7 deletions

View File

@ -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);