@@ -209,7 +209,7 @@ int boot_header_scramble_off_sz(const struct flash_area *fa, int slot, size_t *o
209209 /* In case of swap offset, header of secondary slot image is positioned
210210 * in second sector of slot.
211211 */
212- if (slot == BOOT_SECONDARY_SLOT ) {
212+ if (slot == BOOT_SLOT_SECONDARY ) {
213213 ret = flash_area_get_sector (fa , 0 , & sector );
214214 if (ret < 0 ) {
215215 return ret ;
@@ -316,7 +316,7 @@ boot_find_status(const struct boot_loader_state *state, int image_index)
316316#if MCUBOOT_SWAP_USING_SCRATCH
317317 state -> scratch .area ,
318318#endif
319- state -> imgs [image_index ][BOOT_PRIMARY_SLOT ].area ,
319+ state -> imgs [image_index ][BOOT_SLOT_PRIMARY ].area ,
320320 };
321321 unsigned int i ;
322322
@@ -470,7 +470,7 @@ boot_read_image_size(struct boot_loader_state *state, int slot, uint32_t *size)
470470 uint32_t protect_tlv_size ;
471471 int rc ;
472472
473- assert (slot == BOOT_PRIMARY_SLOT || slot == BOOT_SECONDARY_SLOT );
473+ assert (slot == BOOT_SLOT_PRIMARY || slot == BOOT_SLOT_SECONDARY );
474474
475475 fap = BOOT_IMG_AREA (state , slot );
476476 assert (fap != NULL );
@@ -636,12 +636,12 @@ boot_initialize_area(struct boot_loader_state *state, int flash_area)
636636 num_sectors = BOOT_MAX_IMG_SECTORS ;
637637
638638 if (flash_area == FLASH_AREA_IMAGE_PRIMARY (BOOT_CURR_IMG (state ))) {
639- out_sectors = BOOT_IMG (state , BOOT_PRIMARY_SLOT ).sectors ;
640- out_num_sectors = & BOOT_IMG (state , BOOT_PRIMARY_SLOT ).num_sectors ;
639+ out_sectors = BOOT_IMG (state , BOOT_SLOT_PRIMARY ).sectors ;
640+ out_num_sectors = & BOOT_IMG (state , BOOT_SLOT_PRIMARY ).num_sectors ;
641641#if BOOT_NUM_SLOTS > 1
642642 } else if (flash_area == FLASH_AREA_IMAGE_SECONDARY (BOOT_CURR_IMG (state ))) {
643- out_sectors = BOOT_IMG (state , BOOT_SECONDARY_SLOT ).sectors ;
644- out_num_sectors = & BOOT_IMG (state , BOOT_SECONDARY_SLOT ).num_sectors ;
643+ out_sectors = BOOT_IMG (state , BOOT_SLOT_SECONDARY ).sectors ;
644+ out_num_sectors = & BOOT_IMG (state , BOOT_SLOT_SECONDARY ).num_sectors ;
645645#if MCUBOOT_SWAP_USING_SCRATCH
646646 } else if (flash_area == FLASH_AREA_IMAGE_SCRATCH ) {
647647 out_sectors = state -> scratch .sectors ;
@@ -677,7 +677,7 @@ boot_write_sz(struct boot_loader_state *state)
677677 * on what the minimum write size is for scratch area, active image slot.
678678 * We need to use the bigger of those 2 values.
679679 */
680- elem_sz = flash_area_align (BOOT_IMG_AREA (state , BOOT_PRIMARY_SLOT ));
680+ elem_sz = flash_area_align (BOOT_IMG_AREA (state , BOOT_SLOT_PRIMARY ));
681681#if MCUBOOT_SWAP_USING_SCRATCH
682682 align = flash_area_align (BOOT_SCRATCH_AREA (state ));
683683 if (align > elem_sz ) {
@@ -700,10 +700,10 @@ boot_read_sectors(struct boot_loader_state *state, struct boot_sector_buffer *se
700700
701701 image_index = BOOT_CURR_IMG (state );
702702
703- BOOT_IMG (state , BOOT_PRIMARY_SLOT ).sectors =
703+ BOOT_IMG (state , BOOT_SLOT_PRIMARY ).sectors =
704704 sectors -> primary [image_index ];
705705#if BOOT_NUM_SLOTS > 1
706- BOOT_IMG (state , BOOT_SECONDARY_SLOT ).sectors =
706+ BOOT_IMG (state , BOOT_SLOT_SECONDARY ).sectors =
707707 sectors -> secondary [image_index ];
708708#if MCUBOOT_SWAP_USING_SCRATCH
709709 state -> scratch .sectors = sectors -> scratch ;
@@ -780,10 +780,10 @@ void boot_fetch_slot_state_sizes(void)
780780
781781 image_index = BOOT_CURR_IMG (boot_get_loader_state ());
782782
783- BOOT_IMG (boot_get_loader_state (), BOOT_PRIMARY_SLOT ).sectors =
783+ BOOT_IMG (boot_get_loader_state (), BOOT_SLOT_PRIMARY ).sectors =
784784 sector_buffers .primary [image_index ];
785785#if BOOT_NUM_SLOTS > 1
786- BOOT_IMG (boot_get_loader_state (), BOOT_SECONDARY_SLOT ).sectors =
786+ BOOT_IMG (boot_get_loader_state (), BOOT_SLOT_SECONDARY ).sectors =
787787 sector_buffers .secondary [image_index ];
788788#if MCUBOOT_SWAP_USING_SCRATCH
789789 boot_get_loader_state ()-> scratch .sectors = sector_buffers .scratch ;
0 commit comments