diff options
Diffstat (limited to 'chip/host/flash.c')
-rw-r--r-- | chip/host/flash.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/chip/host/flash.c b/chip/host/flash.c index 9f79298d60..6eef197e78 100644 --- a/chip/host/flash.c +++ b/chip/host/flash.c @@ -39,12 +39,10 @@ static int flash_check_protect(int offset, int size) static void flash_set_persistent(void) { FILE *f = get_persistent_storage("flash", "wb"); - int sz; ASSERT(f != NULL); - sz = fwrite(__host_flash, sizeof(__host_flash), 1, f); - ASSERT(sz == 1); + ASSERT(fwrite(__host_flash, sizeof(__host_flash), 1, f) == 1); release_persistent_storage(f); } @@ -60,7 +58,7 @@ static void flash_get_persistent(void) return; } - fread(__host_flash, sizeof(__host_flash), 1, f); + ASSERT(fread(__host_flash, sizeof(__host_flash), 1, f) == 1); release_persistent_storage(f); } |