mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:52:44 +01:00
Refactor verification check to remove goto and label
This commit is contained in:
parent
d87a5af7c6
commit
d31a39d7fc
@ -177,16 +177,13 @@ int riotboot_flashwrite_finish_raw(riotboot_flashwrite_t *state,
|
||||
}
|
||||
|
||||
int flashpage = flashpage_page((void *)slot_start);
|
||||
if (flashpage_write_and_verify(flashpage, firstpage) != FLASHPAGE_OK) {
|
||||
if (flashpage_write_and_verify(flashpage, firstpage) == FLASHPAGE_OK) {
|
||||
LOG_INFO(LOG_PREFIX "riotboot flashing completed successfully\n");
|
||||
res = 0;
|
||||
}
|
||||
else {
|
||||
LOG_WARNING(LOG_PREFIX "re-flashing first block failed!\n");
|
||||
goto out;
|
||||
}
|
||||
#endif /* !CONFIG_RIOTBOOT_FLASHWRITE_RAW */
|
||||
LOG_INFO(LOG_PREFIX "riotboot flashing completed successfully\n");
|
||||
res = 0;
|
||||
|
||||
#if !CONFIG_RIOTBOOT_FLASHWRITE_RAW
|
||||
out:
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user