summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Holliday <maholli@stanford.edu>2020-05-09 12:16:04 -0700
committerMax Holliday <maholli@stanford.edu>2020-05-09 12:16:04 -0700
commit964040b7702a66f44aa8e9f4af6cf74712ed44ed (patch)
tree7ee524141107ba401003fbebb71ca37c8ed52a72
parent8b6587a0c646089608b0c8bbace97a73462cf88f (diff)
More erroneous else statements
-rw-r--r--supervisor/shared/external_flash/external_flash.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c
index 71b2d6d54..5bde7fd48 100644
--- a/supervisor/shared/external_flash/external_flash.c
+++ b/supervisor/shared/external_flash/external_flash.c
@@ -62,13 +62,12 @@ static bool wait_for_flash_ready(void) {
if (flash_device->no_ready_bit){
// For NVM without a ready bit in status register
return ok;
- } else {
- uint8_t read_status_response[1] = {0x00};
- do {
- ok = spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1);
- } while (ok && (read_status_response[0] & 0x3) != 0);
- return ok;
}
+ uint8_t read_status_response[1] = {0x00};
+ do {
+ ok = spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1);
+ } while (ok && (read_status_response[0] & 0x3) != 0);
+ return ok;
}
// Turn on the write enable bit so we can program and erase the flash.
@@ -171,10 +170,9 @@ static bool erase_sector(uint32_t sector_address) {
}
if (flash_device->no_erase_cmd) {
return true;
- } else {
+ }
spi_flash_sector_command(CMD_SECTOR_ERASE, sector_address);
return true;
- }
}
// Sector is really 24 bits.