diff options
author | Patrick Georgi <patrick@georgi-clan.de> | 2015-08-25 22:27:57 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-08-27 15:06:51 +0000 |
commit | d5a4afa63d61e21851f0d46cab27b4eb9698ad90 (patch) | |
tree | 0a8c61e09e18b2e7bec0ff282e611a7ada91c327 /util | |
parent | a60e7b6da533c119cae0b83207222f7b94f40539 (diff) |
cbfstool: don't pass header_size as separate argument
It's already present inside struct cbfs_file
Change-Id: Ib10663c6601aa02e07b868e440f05da02af9c2d9
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11332
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/cbfstool/cbfs_image.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c index 53ce604764..f93cfef71b 100644 --- a/util/cbfstool/cbfs_image.c +++ b/util/cbfstool/cbfs_image.c @@ -457,8 +457,7 @@ static int cbfs_add_entry_at(struct cbfs_image *image, struct cbfs_file *entry, const void *data, uint32_t content_offset, - const struct cbfs_file *header, - uint32_t header_size) + const struct cbfs_file *header) { struct cbfs_file *next = cbfs_find_next_entry(image, entry); uint32_t addr = cbfs_get_entry_addr(image, entry), @@ -467,6 +466,7 @@ static int cbfs_add_entry_at(struct cbfs_image *image, uint32_t len, header_offset; uint32_t align = image->has_header ? image->header.align : CBFS_ENTRY_ALIGNMENT; + uint32_t header_size = ntohl(header->offset); header_offset = content_offset - header_size; if (header_offset % align) @@ -605,9 +605,8 @@ int cbfs_add_entry(struct cbfs_image *image, struct buffer *buffer, DEBUG("section 0x%x+0x%x for content_offset 0x%x.\n", addr, addr_next - addr, content_offset); - if (cbfs_add_entry_at(image, entry, - buffer->data, content_offset, header, - header_size) == 0) { + if (cbfs_add_entry_at(image, entry, buffer->data, + content_offset, header) == 0) { return 0; } break; |