Lines Matching refs:rc
81 int rc; in boot_read_image_header() local
91 rc = BOOT_EFLASH; in boot_read_image_header()
119 rc = flash_area_open(area_id, &fap); in boot_read_image_header()
120 if (rc != 0) { in boot_read_image_header()
121 rc = BOOT_EFLASH; in boot_read_image_header()
125 rc = flash_area_read(fap, off, out_hdr, sizeof *out_hdr); in boot_read_image_header()
126 if (rc != 0) { in boot_read_image_header()
127 rc = BOOT_EFLASH; in boot_read_image_header()
133 rc = -1; in boot_read_image_header()
137 rc = 0; in boot_read_image_header()
141 return rc; in boot_read_image_header()
154 int rc; in swap_read_status_bytes() local
171 rc = flash_area_read(fap, off + (i - 1) * write_sz, &status, 1); in swap_read_status_bytes()
172 if (rc < 0) { in swap_read_status_bytes()
177 if (rc != last_rc) { in swap_read_status_bytes()
185 last_rc = rc; in swap_read_status_bytes()
347 int rc; in swap_status_source() local
357 rc = boot_read_swap_state_by_id(FLASH_AREA_IMAGE_PRIMARY(image_index), in swap_status_source()
359 assert(rc == 0); in swap_status_source()
363 rc = boot_read_swap_state_by_id(FLASH_AREA_IMAGE_SECONDARY(image_index), in swap_status_source()
365 assert(rc == 0); in swap_status_source()
393 int rc; in boot_move_sector_up() local
406 rc = swap_erase_trailer_sectors(state, fap_pri); in boot_move_sector_up()
407 assert(rc == 0); in boot_move_sector_up()
409 rc = swap_status_init(state, fap_pri, bs); in boot_move_sector_up()
410 assert(rc == 0); in boot_move_sector_up()
413 rc = swap_erase_trailer_sectors(state, fap_sec); in boot_move_sector_up()
414 assert(rc == 0); in boot_move_sector_up()
417 rc = boot_erase_region(fap_pri, new_off, sz); in boot_move_sector_up()
418 assert(rc == 0); in boot_move_sector_up()
420 rc = boot_copy_region(state, fap_pri, fap_pri, old_off, new_off, sz); in boot_move_sector_up()
421 assert(rc == 0); in boot_move_sector_up()
423 rc = boot_write_status(state, bs); in boot_move_sector_up()
426 BOOT_STATUS_ASSERT(rc == 0); in boot_move_sector_up()
437 int rc; in boot_swap_sectors() local
444 rc = boot_erase_region(fap_pri, pri_off, sz); in boot_swap_sectors()
445 assert(rc == 0); in boot_swap_sectors()
447 rc = boot_copy_region(state, fap_sec, fap_pri, sec_off, pri_off, sz); in boot_swap_sectors()
448 assert(rc == 0); in boot_swap_sectors()
450 rc = boot_write_status(state, bs); in boot_swap_sectors()
452 BOOT_STATUS_ASSERT(rc == 0); in boot_swap_sectors()
456 rc = boot_erase_region(fap_sec, sec_off, sz); in boot_swap_sectors()
457 assert(rc == 0); in boot_swap_sectors()
459 rc = boot_copy_region(state, fap_pri, fap_sec, pri_up_off, sec_off, sz); in boot_swap_sectors()
460 assert(rc == 0); in boot_swap_sectors()
462 rc = boot_write_status(state, bs); in boot_swap_sectors()
465 BOOT_STATUS_ASSERT(rc == 0); in boot_swap_sectors()
484 int rc; in fixup_revert() local
497 rc = boot_read_swap_state(fap_sec, &swap_state); in fixup_revert()
498 assert(rc == 0); in fixup_revert()
503 rc = swap_erase_trailer_sectors(state, fap_sec); in fixup_revert()
504 assert(rc == 0); in fixup_revert()
506 rc = boot_write_image_ok(fap_sec); in fixup_revert()
507 assert(rc == 0); in fixup_revert()
509 rc = boot_write_swap_size(fap_sec, bs->swap_size); in fixup_revert()
510 assert(rc == 0); in fixup_revert()
512 rc = boot_write_magic(fap_sec); in fixup_revert()
513 assert(rc == 0); in fixup_revert()
530 int rc; in swap_run() local
565 rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY(image_index), &fap_pri); in swap_run()
566 assert (rc == 0); in swap_run()
568 rc = flash_area_open(FLASH_AREA_IMAGE_SECONDARY(image_index), &fap_sec); in swap_run()
569 assert (rc == 0); in swap_run()