1
0
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:
Koen Zandberg 2020-10-19 14:11:50 +02:00
parent d87a5af7c6
commit d31a39d7fc
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B

View File

@ -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;
}