summaryrefslogtreecommitdiff
path: root/payloads
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2015-07-09 15:07:45 -0700
committerPatrick Georgi <pgeorgi@google.com>2015-09-17 18:52:41 +0000
commit5c6dc72501329226b9ead5a184fb49f5af732dd3 (patch)
tree44fd0a9e596d1646addadf90b4f369568da1831e /payloads
parent377d1db57dae282cda94a2c24994707a32efdd00 (diff)
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 <dnojiri@chromium.org> Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11676 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'payloads')
-rw-r--r--payloads/libpayload/libcbfs/cbfs_core.c24
1 files changed, 12 insertions, 12 deletions
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.