@@ -510,25 +510,18 @@ boot_write_copy_done(const struct flash_area *fap)
510
510
511
511
#ifdef SEND_BOOT_REQUEST
512
512
static int
513
- send_boot_request (uint8_t magic , uint8_t image_ok , bool confirm , int image_id ,
514
- uint32_t slot_id )
513
+ send_boot_request (uint8_t magic , bool confirm , int image_id , uint32_t slot_id )
515
514
{
516
515
int rc = BOOT_EBADIMAGE ;
517
516
518
517
/* Handle write-protected active image. */
519
518
if ((magic == BOOT_MAGIC_GOOD ) || (magic == BOOT_MAGIC_UNSET )) {
520
519
if (confirm ) {
521
520
BOOT_LOG_DBG ("Confirm image: %d, %d" , image_id , slot_id );
522
- if ((image_ok != BOOT_FLAG_SET ) || (magic != BOOT_MAGIC_GOOD )) {
523
- rc = boot_request_confirm_slot (image_id , slot_id );
524
- } else {
525
- rc = 0 ;
526
- }
527
- #ifdef CONFIG_NCS_MCUBOOT_BOOT_REQUEST_TEST_SETS_BOOT_PREFERENCE
521
+ rc = boot_request_confirm_slot (image_id , slot_id );
528
522
} else {
529
523
BOOT_LOG_DBG ("Set image preference: %d, %d" , image_id , slot_id );
530
524
rc = boot_request_set_preferred_slot (image_id , slot_id );
531
- #endif /* CONFIG_NCS_MCUBOOT_BOOT_REQUEST_TEST_SETS_BOOT_PREFERENCE */
532
525
}
533
526
if (rc != 0 ) {
534
527
rc = BOOT_EBADIMAGE ;
@@ -601,8 +594,7 @@ boot_set_next(const struct flash_area *fa, bool active, bool confirm)
601
594
image_id = flash_area_to_image_slot (fa , & slot_id );
602
595
603
596
#ifdef SEND_BOOT_REQUEST
604
- rc = send_boot_request (slot_state .magic , slot_state .image_ok , confirm ,
605
- image_id , slot_id );
597
+ rc = send_boot_request (slot_state .magic , confirm , image_id , slot_id );
606
598
if ((rc != 0 ) || active ) {
607
599
return rc ;
608
600
}
@@ -694,8 +686,7 @@ boot_set_next(const struct flash_area *fa, bool active, bool confirm)
694
686
#ifdef SEND_BOOT_REQUEST
695
687
image_id = flash_area_to_image_slot (fa , & slot_id );
696
688
697
- rc = send_boot_request (slot_state .magic , slot_state .image_ok , confirm ,
698
- image_id , slot_id );
689
+ rc = send_boot_request (slot_state .magic , confirm , image_id , slot_id );
699
690
if ((rc != 0 ) || active ) {
700
691
return rc ;
701
692
}
0 commit comments