Skip to content

Commit 4d9ed52

Browse files
committed
bootutil: Remove NULL state logic from boot_state_clear
No need to keep this defaulting logic. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
1 parent b01b1e0 commit 4d9ed52

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

boot/bootutil/src/bootutil_misc.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -643,15 +643,9 @@ const struct image_max_size *boot_get_max_app_size(void)
643643
* Clears the boot state, so that previous operations have no effect on new
644644
* ones.
645645
*
646-
* @param state The state that should be cleared. If the value
647-
* is NULL, the default bootloader state will be
648-
* cleared.
646+
* @param state The state that should be cleared.
649647
*/
650648
void boot_state_clear(struct boot_loader_state *state)
651649
{
652-
if (state != NULL) {
653-
memset(state, 0, sizeof(struct boot_loader_state));
654-
} else {
655-
memset(boot_get_loader_state(), 0, sizeof(struct boot_loader_state));
656-
}
650+
memset(state, 0, sizeof(struct boot_loader_state));
657651
}

0 commit comments

Comments
 (0)