tree: Use accessor functions for struct region fields

Always use the high-level API region_offset() and region_sz()
functions. This excludes the internal `region.c` code as well
as unit tests. FIT payload support was also skipped, as it
seems it never tried to use the API and would need a bigger
overhaul.

Change-Id: Iaae116a1ab2da3b2ea2a5ebcd0c300b238582834
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79904
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
This commit is contained in:
Nico Huber
2024-01-11 18:50:50 +01:00
committed by Martin L Roth
parent 8a6045c3d0
commit d7612e9765
4 changed files with 23 additions and 23 deletions

View File

@@ -235,15 +235,15 @@ int fmap_find_region_name(const struct region * const ar,
if (area == NULL)
return -1;
if ((ar->offset != le32toh(area->offset)) ||
(ar->size != le32toh(area->size))) {
if (region_offset(ar) != le32toh(area->offset) ||
region_sz(ar) != le32toh(area->size)) {
rdev_munmap(&fmrd, area);
offset += sizeof(struct fmap_area);
continue;
}
printk(BIOS_DEBUG, "FMAP: area (%zx, %zx) found, named %s\n",
ar->offset, ar->size, area->name);
region_offset(ar), region_sz(ar), area->name);
memcpy(name, area->name, FMAP_STRLEN);
@@ -253,7 +253,7 @@ int fmap_find_region_name(const struct region * const ar,
}
printk(BIOS_DEBUG, "FMAP: area (%zx, %zx) not found\n",
ar->offset, ar->size);
region_offset(ar), region_sz(ar));
return -1;
}