From 4d3e4c421e94814884d1ff035a4c4ec80d4b33b2 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Tue, 14 Jul 2015 22:28:27 +0200 Subject: cbfs: hardcode file alignment Assume that it's 64 byte. Change-Id: I168facd92f64c2cf99c26c350c60317807a4aed4 Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/10919 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/lib/cbfs.c | 9 +++------ src/lib/cbfs_boot_props.c | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src/lib') 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; } diff --git a/src/lib/cbfs_boot_props.c b/src/lib/cbfs_boot_props.c index 21e64d37a5..7a9f7a98e0 100644 --- a/src/lib/cbfs_boot_props.c +++ b/src/lib/cbfs_boot_props.c @@ -49,13 +49,11 @@ int __attribute__((weak)) cbfs_boot_region_properties(struct cbfs_props *props) header.magic = ntohl(header.magic); header.romsize = ntohl(header.romsize); - header.align = ntohl(header.align); header.offset = ntohl(header.offset); if (header.magic != CBFS_HEADER_MAGIC) return -1; - props->align = header.align; props->offset = header.offset; props->size = header.romsize; props->size -= props->offset; -- cgit v1.2.3