Commit 24769883 authored by Dominik Ermel's avatar Dominik Ermel Committed by David Brown
Browse files

boot: Switch to flash_area_get_sector.

Replace flash_area_sector_from_off calls with flash_area_get_sector.

Signed-off-by: default avatarDominik Ermel <dominik.ermel@nordicsemi.no>
parent bd0d94ce
Loading
Loading
Loading
Loading
+2 −2
Changes for boot/boot_serial/src/boot_serial.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ static off_t erase_range(const struct flash_area *fap, off_t start, off_t end)
        return start;
    }

    if (flash_area_sector_from_off(end, &sect)) {
    if (flash_area_get_sector(fap, end, &sect)) {
        return -EINVAL;
    }

@@ -437,7 +437,7 @@ bs_upload(char *buf, int len)
         * TODO: This is single occurrence issue, it should get detected during tests
         * and fixed otherwise you are deploying broken mcuboot.
         */
        if (flash_area_sector_from_off(boot_status_off(fap), &status_sector)) {
        if (flash_area_get_sector(fap, boot_status_off(fap), &status_sector)) {
            rc = MGMT_ERR_EUNKNOWN;
            BOOT_LOG_ERR("Unable to determine flash sector of the image trailer");
            goto out;
+1 −1
Changes for boot/bootutil/src/bootutil_misc.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -350,7 +350,7 @@ uint32_t bootutil_max_image_size(const struct flash_area *fap)
#elif defined(MCUBOOT_SWAP_USING_MOVE)
    struct flash_sector sector;
    /* get the last sector offset */
    int rc = flash_area_sector_from_off(boot_status_off(fap), &sector);
    int rc = flash_area_get_sector(fap, boot_status_off(fap), &sector);
    if (rc) {
        BOOT_LOG_ERR("Unable to determine flash sector of the image trailer");
        return 0; /* Returning of zero here should cause any check which uses