@@ -791,7 +791,7 @@ boot_validate_slot(struct boot_loader_state *state, int slot,
791791#endif
792792 !boot_check_header_erased (state , BOOT_SLOT_PRIMARY )
793793 ) {
794- BOOT_LOG_ERR ("insufficient version in secondary slot" );
794+ BOOT_LOG_ERR ("Insufficient version in secondary slot" );
795795 boot_scramble_slot (fap , slot );
796796 /* Image in the secondary slot does not satisfy version requirement.
797797 * Erase the image and continue booting from the primary slot.
@@ -1674,7 +1674,7 @@ boot_copy_image(struct boot_loader_state *state, struct boot_status *bs)
16741674 */
16751675 rc = boot_update_security_counter (state , BOOT_SLOT_PRIMARY , BOOT_SLOT_SECONDARY );
16761676 if (rc != 0 ) {
1677- BOOT_LOG_ERR ("Security counter update failed after image upgrade." );
1677+ BOOT_LOG_ERR ("Security counter update failed after image upgrade: %d" , rc );
16781678 return rc ;
16791679 }
16801680#endif /* MCUBOOT_HW_ROLLBACK_PROT */
@@ -1932,8 +1932,7 @@ boot_perform_update(struct boot_loader_state *state, struct boot_status *bs)
19321932 */
19331933 rc = boot_update_security_counter (state , BOOT_SLOT_PRIMARY , BOOT_SLOT_SECONDARY );
19341934 if (rc != 0 ) {
1935- BOOT_LOG_ERR ("Security counter update failed after "
1936- "image upgrade." );
1935+ BOOT_LOG_ERR ("Security counter update failed after image upgrade: %d" , rc );
19371936 BOOT_SWAP_TYPE (state ) = BOOT_SWAP_TYPE_PANIC ;
19381937 }
19391938 }
@@ -2277,16 +2276,16 @@ boot_update_hw_rollback_protection(struct boot_loader_state *state)
22772276 if (swap_state .magic != BOOT_MAGIC_GOOD || swap_state .image_ok == BOOT_FLAG_SET ) {
22782277 rc = boot_update_security_counter (state , BOOT_SLOT_PRIMARY , BOOT_SLOT_PRIMARY );
22792278 if (rc != 0 ) {
2280- BOOT_LOG_ERR ("Security counter update failed after image %d validation. " ,
2281- BOOT_CURR_IMG (state ));
2279+ BOOT_LOG_ERR ("Security counter update failed after image %d validation: %d " ,
2280+ BOOT_CURR_IMG (state ), rc );
22822281 return rc ;
22832282 }
22842283
22852284#ifdef MCUBOOT_HW_ROLLBACK_PROT_LOCK
22862285 rc = boot_nv_security_counter_lock (BOOT_CURR_IMG (state ));
22872286 if (rc != 0 ) {
2288- BOOT_LOG_ERR ("Security counter lock failed after image %d validation. " ,
2289- BOOT_CURR_IMG (state ));
2287+ BOOT_LOG_ERR ("Security counter lock failed after image %d validation: %d " ,
2288+ BOOT_CURR_IMG (state ), rc );
22902289 return rc ;
22912290 }
22922291#endif /* MCUBOOT_HW_ROLLBACK_PROT_LOCK */
@@ -2425,8 +2424,8 @@ context_boot_go(struct boot_loader_state *state, struct boot_rsp *rsp)
24252424 /* Determine the sector layout of the image slots and scratch area. */
24262425 rc = boot_read_sectors (state , sectors );
24272426 if (rc != 0 ) {
2428- BOOT_LOG_WRN ("Failed reading sectors; BOOT_MAX_IMG_SECTORS=%d"
2429- " - too small?" , BOOT_MAX_IMG_SECTORS );
2427+ BOOT_LOG_WRN ("Failed reading sectors; BOOT_MAX_IMG_SECTORS=%d - too small?" ,
2428+ BOOT_MAX_IMG_SECTORS );
24302429 BOOT_SWAP_TYPE (state ) = BOOT_SWAP_TYPE_NONE ;
24312430 }
24322431
@@ -2611,7 +2610,7 @@ context_boot_go(struct boot_loader_state *state, struct boot_rsp *rsp)
26112610 * the magic number on the image is OK.
26122611 */
26132612 if (BOOT_IMG (state , BOOT_SLOT_PRIMARY ).hdr .ih_magic != IMAGE_MAGIC ) {
2614- BOOT_LOG_ERR ("bad image magic 0x%lx; Image=%u" , (unsigned long )
2613+ BOOT_LOG_ERR ("Bad image magic 0x%lx; Image=%u" , (unsigned long )
26152614 BOOT_IMG (state , BOOT_SLOT_PRIMARY ).hdr .ih_magic ,
26162615 BOOT_CURR_IMG (state ));
26172616 rc = BOOT_EBADIMAGE ;
@@ -2784,10 +2783,8 @@ boot_get_slot_usage(struct boot_loader_state *state)
27842783 BOOT_LOG_IMAGE_INFO (slot , hdr );
27852784 } else {
27862785 state -> slot_usage [BOOT_CURR_IMG (state )].slot_available [slot ] = false;
2787- BOOT_LOG_INF ("Image %d %s slot: Image not found" ,
2788- BOOT_CURR_IMG (state ),
2789- (slot == BOOT_SLOT_PRIMARY )
2790- ? "Primary" : "Secondary" );
2786+ BOOT_LOG_INF ("Image %d %s slot: image not found" , BOOT_CURR_IMG (state ),
2787+ (slot == BOOT_SLOT_PRIMARY ) ? "primary" : "secondary" );
27912788 }
27922789 }
27932790
@@ -2855,10 +2852,8 @@ print_loaded_images(struct boot_loader_state *state)
28552852#endif
28562853 active_slot = state -> slot_usage [BOOT_CURR_IMG (state )].active_slot ;
28572854
2858- BOOT_LOG_INF ("Image %d loaded from the %s slot" ,
2859- BOOT_CURR_IMG (state ),
2860- (active_slot == BOOT_SLOT_PRIMARY ) ?
2861- "primary" : "secondary" );
2855+ BOOT_LOG_INF ("Image %d loaded from the %s slot" , BOOT_CURR_IMG (state ),
2856+ (active_slot == BOOT_SLOT_PRIMARY ) ? "primary" : "secondary" );
28622857 }
28632858}
28642859#endif
@@ -2951,9 +2946,8 @@ boot_select_or_erase(struct boot_loader_state *state)
29512946 */
29522947 rc = boot_write_copy_done (fap );
29532948 if (rc != 0 ) {
2954- BOOT_LOG_WRN ("Failed to set copy_done flag of the image in "
2955- "the %s slot." , (active_slot == BOOT_SLOT_PRIMARY ) ?
2956- "primary" : "secondary" );
2949+ BOOT_LOG_WRN ("Failed to set copy_done flag of the image in the %s slot." ,
2950+ (active_slot == BOOT_SLOT_PRIMARY ) ? "primary" : "secondary" );
29572951 rc = 0 ;
29582952 }
29592953 }
@@ -2997,8 +2991,7 @@ boot_load_and_validate_images(struct boot_loader_state *state)
29972991 }
29982992
29992993 if (active_slot == BOOT_SLOT_NONE ) {
3000- BOOT_LOG_INF ("No slot to load for image %d" ,
3001- BOOT_CURR_IMG (state ));
2994+ BOOT_LOG_INF ("No slot to load for image %d" , BOOT_CURR_IMG (state ));
30022995 FIH_RET (FIH_FAILURE );
30032996 }
30042997
@@ -3094,16 +3087,16 @@ boot_update_hw_rollback_protection(struct boot_loader_state *state)
30943087 state -> slot_usage [BOOT_CURR_IMG (state )].active_slot ,
30953088 state -> slot_usage [BOOT_CURR_IMG (state )].active_slot );
30963089 if (rc != 0 ) {
3097- BOOT_LOG_ERR ("Security counter update failed after image %d validation. " ,
3098- BOOT_CURR_IMG (state ));
3090+ BOOT_LOG_ERR ("Security counter update failed after image %d validation: %d " ,
3091+ BOOT_CURR_IMG (state ), rc );
30993092 return rc ;
31003093 }
31013094
31023095#ifdef MCUBOOT_HW_ROLLBACK_PROT_LOCK
31033096 rc = boot_nv_security_counter_lock (BOOT_CURR_IMG (state ));
31043097 if (rc != 0 ) {
3105- BOOT_LOG_ERR ("Security counter lock failed after image %d validation. " ,
3106- BOOT_CURR_IMG (state ));
3098+ BOOT_LOG_ERR ("Security counter lock failed after image %d validation: %d " ,
3099+ BOOT_CURR_IMG (state ), rc );
31073100 return rc ;
31083101 }
31093102#endif /* MCUBOOT_HW_ROLLBACK_PROT_LOCK */
0 commit comments