[coreboot-gerrit] Patch set updated for coreboot: cbfstool: don't pass header_size as separate argument

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Wed Aug 26 14:24:18 CEST 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11332

-gerrit

commit 532c373a7232a2391be63c0daf9fc44fa573c38b
Author: Patrick Georgi <patrick at georgi-clan.de>
Date:   Tue Aug 25 22:27:57 2015 +0200

    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 at georgi-clan.de>
---
 util/cbfstool/cbfs_image.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index 53ce604..f93cfef 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;



More information about the coreboot-gerrit mailing list