flash: fix clang static analyzer build errors
[fw/openocd] / src / flash / nor / stmqspi.c
index f6a4934141b21c94f679fc716cb2d7bf6e16c470..8278601db2a104ea25faeea886a3cb4d2dc394d6 100644 (file)
@@ -40,6 +40,7 @@
 #endif
 
 #include "imp.h"
+#include <helper/binarybuffer.h>
 #include <helper/bits.h>
 #include <helper/time_support.h>
 #include <target/algorithm.h>
@@ -588,18 +589,13 @@ COMMAND_HANDLER(stmqspi_handle_mass_erase_command)
        retval = wait_till_ready(bank, SPI_MASS_ERASE_TIMEOUT);
 
        duration_measure(&bench);
-       if (retval == ERROR_OK) {
-               /* set all sectors as erased */
-               for (sector = 0; sector < bank->num_sectors; sector++)
-                       bank->sectors[sector].is_erased = 1;
-
+       if (retval == ERROR_OK)
                command_print(CMD, "stmqspi mass erase completed in %fs (%0.3f KiB/s)",
                        duration_elapsed(&bench),
                        duration_kbps(&bench, bank->size));
-       } else {
+       else
                command_print(CMD, "stmqspi mass erase not completed even after %fs",
                        duration_elapsed(&bench));
-       }
 
 err:
        /* Switch to memory mapped mode before return to prompt */