Skip to content

Commit 388a9da

Browse files
tomchynordicjm
authored andcommitted
[nrf fromtree] hooks: Use dedicated type for slot numbers
Use the dedicated type to specify the slot number. Signed-off-by: Tomasz Chyrowicz <[email protected]> (cherry picked from commit d5b0dcb9aaee397fc105ae2228e8030038c3d871)
1 parent 511e742 commit 388a9da

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

boot/bootutil/include/bootutil/boot_hooks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,6 @@ int flash_area_get_device_id_hook(const struct flash_area *fa,
282282
* @return 0 if a slot was requested;
283283
* BOOT_HOOK_REGULAR follow the normal execution path.
284284
*/
285-
int boot_find_next_slot_hook(struct boot_loader_state *state, uint8_t image, uint32_t *active_slot);
285+
int boot_find_next_slot_hook(struct boot_loader_state *state, uint8_t image, enum boot_slot *active_slot);
286286

287287
#endif /*H_BOOTUTIL_HOOKS*/

boot/zephyr/hooks_sample.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ int boot_img_install_stat_hook(int image_index, int slot, int *img_install_stat)
9494
return BOOT_HOOK_REGULAR;
9595
}
9696

97-
int boot_find_next_slot_hook(struct boot_loader_state *state, uint8_t image, uint32_t *active_slot)
97+
int boot_find_next_slot_hook(struct boot_loader_state *state, uint8_t image,
98+
enum boot_slot *active_slot)
9899
{
99100
return BOOT_HOOK_REGULAR;
100101
}

0 commit comments

Comments
 (0)