aboutsummaryrefslogtreecommitdiff
path: root/core/mem_region.c
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.ibm.com>2018-06-28 12:55:00 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-07-16 23:48:30 -0500
commit2c30ddb93baf34c0191e5c23579c03a8f76f27c4 (patch)
tree2b988d20abb8e55253976eae89345b033ee43638 /core/mem_region.c
parent4757519c697e43d136d8e9eef5d5ac836caa7299 (diff)
downloadskiboot-2c30ddb93baf34c0191e5c23579c03a8f76f27c4.zip
skiboot-2c30ddb93baf34c0191e5c23579c03a8f76f27c4.tar.gz
skiboot-2c30ddb93baf34c0191e5c23579c03a8f76f27c4.tar.bz2
mem_check(): Correct alignment assumptions
Back in the dim dark past, mem_check() was written to take the assumption that mem regions need to be sizeof(alloc_hdr) aligned. I can't see any real reason for this, so change it to sizeof(long) aligned as we count space by number of longs, so at least that kind of makes sense. We hit this assert in a future patch when preserving BOOTKERNEL across fast reboots. Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core/mem_region.c')
-rw-r--r--core/mem_region.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/mem_region.c b/core/mem_region.c
index 0b2961d..0051ea6 100644
--- a/core/mem_region.c
+++ b/core/mem_region.c
@@ -548,12 +548,12 @@ bool mem_check(const struct mem_region *region)
struct free_hdr *f;
/* Check it's sanely aligned. */
- if (region->start % sizeof(struct alloc_hdr)) {
+ if (region->start % sizeof(long)) {
prerror("Region '%s' not sanely aligned (%llx)\n",
region->name, (unsigned long long)region->start);
return false;
}
- if ((long)region->len % sizeof(struct alloc_hdr)) {
+ if ((long)region->len % sizeof(long)) {
prerror("Region '%s' not sane length (%llu)\n",
region->name, (unsigned long long)region->len);
return false;