From d5a4afa63d61e21851f0d46cab27b4eb9698ad90 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Tue, 25 Aug 2015 22:27:57 +0200 Subject: 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 Reviewed-on: http://review.coreboot.org/11332 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- util/cbfstool/cbfs_image.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'util') 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; -- cgit v1.2.3