Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boot/bootutil: Remove direct accesses to flash_area::fa_xyz #1929

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boot/bootutil/src/bootutil_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ boot_status_off(const struct flash_area *fap)
elem_sz = flash_area_align(fap);

#if MCUBOOT_SWAP_USING_SCRATCH
if (fap->fa_id == FLASH_AREA_IMAGE_SCRATCH) {
if (flash_area_get_id(fap) == FLASH_AREA_IMAGE_SCRATCH) {
off_from_end = boot_scratch_trailer_sz(elem_sz);
} else {
#endif
Expand Down
2 changes: 1 addition & 1 deletion boot/bootutil/src/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ boot_validate_slot(struct boot_loader_state *state, int slot,
goto out;
}

if (reset_value < pri_fa->fa_off || reset_value> (pri_fa->fa_off + pri_fa->fa_size)) {
if (reset_value < flash_area_get_off(pri_fa) || reset_value > (flash_area_get_off(pri_fa) + flash_area_get_size(pri_fa))) {
BOOT_LOG_ERR("Reset address of image in secondary slot is not in the primary slot");
BOOT_LOG_ERR("Erasing image from secondary slot");

Expand Down
2 changes: 2 additions & 0 deletions docs/release-notes.d/bootutil-sector.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- bootutil: Removed manual mentions to `flash_area::fa_xyz`,
allowing for an opaque `flash_area` definition.
- bootutil: Fixed issue with comparing sector sizes for
compatibility, this now also checks against the number of usable
sectors (which is the slot size minus the swap status and moved
Expand Down
Loading