summaryrefslogtreecommitdiff
path: root/src/lib/cbfs.c
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2015-07-14 22:28:27 +0200
committerPatrick Georgi <pgeorgi@google.com>2015-07-15 16:34:37 +0200
commit4d3e4c421e94814884d1ff035a4c4ec80d4b33b2 (patch)
tree714cf2a02ad6ee568928084df4c5cc36530ae96f /src/lib/cbfs.c
parent45acb34ffce5ffef1e574305b4e18af6d26df46b (diff)
cbfs: hardcode file alignment
Assume that it's 64 byte. Change-Id: I168facd92f64c2cf99c26c350c60317807a4aed4 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10919 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/lib/cbfs.c')
-rw-r--r--src/lib/cbfs.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 3e83765bf3..abc40770af 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -57,7 +57,6 @@ int cbfs_boot_locate(struct region_device *fh, const char *name, uint32_t *type)
return -1;
cbfs.rdev = &rdev;
- cbfs.align = props.align;
return cbfs_locate(fh, &cbfs, name, type);
}
@@ -83,11 +82,9 @@ int cbfs_locate(struct region_device *fh, const struct cbfsd *cbfs,
{
size_t offset;
const struct region_device *rd;
- size_t align;
offset = 0;
rd = cbfs->rdev;
- align = cbfs->align;
LOG("Locating '%s'\n", name);
@@ -107,7 +104,7 @@ int cbfs_locate(struct region_device *fh, const struct cbfsd *cbfs,
if (memcmp(file.magic, CBFS_FILE_MAGIC, sizeof(file.magic))) {
offset++;
- offset = ALIGN_UP(offset, align);
+ offset = ALIGN_UP(offset, CBFS_ALIGNMENT);
continue;
}
@@ -127,14 +124,14 @@ int cbfs_locate(struct region_device *fh, const struct cbfsd *cbfs,
if (!name_match) {
DEBUG(" Unmatched '%s' at %zx\n", fname, offset);
offset += file.offset + file.len;
- offset = ALIGN_UP(offset, align);
+ offset = ALIGN_UP(offset, CBFS_ALIGNMENT);
continue;
}
if (type != NULL && *type != file.type) {
DEBUG(" Unmatched type %x at %zx\n", file.type, offset);
offset += file.offset + file.len;
- offset = ALIGN_UP(offset, align);
+ offset = ALIGN_UP(offset, CBFS_ALIGNMENT);
continue;
}