Commit 0ab87b61 authored by Dominik Ermel's avatar Dominik Ermel Committed by Fabio Utzig
Browse files

bootutil: Remove area ID parameter from fixup_revert

The fixup_revert has been switched to use boot_read_swap_state,
from boot_read_swap_state_by_id, and no longer needs the ID
parameter.  It can now get swap state information by flash_area
object pointer, which is provided as 3rd parameter.

Signed-off-by: default avatarDominik Ermel <dominik.ermel@nordicsemi.no>
parent 8115998c
Loading
Loading
Loading
Loading
+3 −3
Changes for boot/bootutil/src/swap_move.c: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -399,7 +399,7 @@ boot_swap_sectors(int idx, uint32_t sz, struct boot_loader_state *state,
 */
void
fixup_revert(const struct boot_loader_state *state, struct boot_status *bs,
        const struct flash_area *fap_sec, uint8_t sec_id)
        const struct flash_area *fap_sec)
{
    struct boot_swap_state swap_state;
    int rc;
@@ -415,7 +415,7 @@ fixup_revert(const struct boot_loader_state *state, struct boot_status *bs,
        return;
    }

    rc = boot_read_swap_state_by_id(sec_id, &swap_state);
    rc = boot_read_swap_state(fap_sec, &swap_state);
    assert(rc == 0);

    BOOT_LOG_SWAP_STATE("Secondary image", &swap_state);
@@ -493,7 +493,7 @@ swap_run(struct boot_loader_state *state, struct boot_status *bs,
    rc = flash_area_open(FLASH_AREA_IMAGE_SECONDARY(image_index), &fap_sec);
    assert (rc == 0);

    fixup_revert(state, bs, fap_sec, FLASH_AREA_IMAGE_SECONDARY(image_index));
    fixup_revert(state, bs, fap_sec);

    if (bs->op == BOOT_STATUS_OP_MOVE) {
        idx = g_last_idx;