From 5c6dc72501329226b9ead5a184fb49f5af732dd3 Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Thu, 9 Jul 2015 15:07:45 -0700 Subject: libpayload: rename cbfs variable from name to vardata The dynamically sized region after struct cbfs_file doesn't contain only the file name anymore. Change-Id: I3241cb2f0cbec3fcf4d3c27d638e2847e43f4761 Signed-off-by: Daisuke Nojiri Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/11676 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- payloads/libpayload/libcbfs/cbfs_core.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'payloads/libpayload') diff --git a/payloads/libpayload/libcbfs/cbfs_core.c b/payloads/libpayload/libcbfs/cbfs_core.c index 6a19b269c1..5541f0242d 100644 --- a/payloads/libpayload/libcbfs/cbfs_core.c +++ b/payloads/libpayload/libcbfs/cbfs_core.c @@ -97,8 +97,8 @@ const struct cbfs_header *cbfs_get_header(struct cbfs_media *media) /* public API starts here*/ struct cbfs_file *cbfs_get_file(struct cbfs_media *media, const char *name) { - const char *file_name; - uint32_t offset, romsize, name_len; + const char *vardata; + uint32_t offset, romsize, vardata_len; const struct cbfs_header *header; struct cbfs_file file, *file_ptr; struct cbfs_media default_media; @@ -153,29 +153,29 @@ struct cbfs_file *cbfs_get_file(struct cbfs_media *media, const char *name) offset += new_align; continue; } - name_len = ntohl(file.offset) - sizeof(file); - DEBUG(" - load entry 0x%x file name (%d bytes)...\n", offset, - name_len); + vardata_len = ntohl(file.offset) - sizeof(file); + DEBUG(" - load entry 0x%x variable data (%d bytes)...\n", + offset, vardata_len); // load file name (arbitrary length). - file_name = (const char*)media->map( - media, offset + sizeof(file), name_len); - if (file_name == CBFS_MEDIA_INVALID_MAP_ADDRESS) { + vardata = (const char*)media->map( + media, offset + sizeof(file), vardata_len); + if (vardata == CBFS_MEDIA_INVALID_MAP_ADDRESS) { ERROR("ERROR: Failed to get filename: 0x%x.\n", offset); - } else if (strcmp(file_name, name) == 0) { + } else if (strcmp(vardata, name) == 0) { int file_offset = ntohl(file.offset), file_len = ntohl(file.len); DEBUG("Found file (offset=0x%x, len=%d).\n", offset + file_offset, file_len); - media->unmap(media, file_name); + media->unmap(media, vardata); file_ptr = media->map(media, offset, file_offset + file_len); media->close(media); return file_ptr; } else { DEBUG(" (unmatched file @0x%x: %s)\n", offset, - file_name); - media->unmap(media, file_name); + vardata); + media->unmap(media, vardata); } // Move to next file. -- cgit v1.2.3