flash/nor: Use proper data types in driver API

Use 'unsigned int' and 'bool' instead of 'int' where appropriate.
While at it, fix some coding style issues.

No new Clang analyzer warnings.

Change-Id: I700802c9ee81c3c7ae73108f0f8f06b15a4345f8
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/4929
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Marc Schink
2020-06-07 17:00:13 +02:00
committed by Tomas Vanek
parent a2e6982a18
commit ef14384b68
70 changed files with 773 additions and 755 deletions

View File

@@ -590,7 +590,8 @@ FLASH_BANK_COMMAND_HANDLER(msp432_flash_bank_command)
return ERROR_OK;
}
static int msp432_erase(struct flash_bank *bank, int first, int last)
static int msp432_erase(struct flash_bank *bank, unsigned int first,
unsigned int last)
{
struct target *target = bank->target;
struct msp432_bank *msp432_bank = bank->driver_priv;
@@ -628,7 +629,7 @@ static int msp432_erase(struct flash_bank *bank, int first, int last)
}
/* Erase requested sectors one by one */
for (int i = first; i <= last; i++) {
for (unsigned int i = first; i <= last; i++) {
/* Skip TVL (read-only) sector of the info bank */
if (is_info && 1 == i)
@@ -809,7 +810,7 @@ static int msp432_probe(struct flash_bank *bank)
uint32_t sector_length;
uint32_t size;
int num_sectors;
unsigned int num_sectors;
bool is_main = FLASH_BASE == bank->base;
bool is_info = P4_FLASH_INFO_BASE == bank->base;
@@ -918,7 +919,7 @@ static int msp432_probe(struct flash_bank *bank)
bank->num_sectors = num_sectors;
msp432_bank->sector_length = sector_length;
for (int i = 0; i < num_sectors; i++) {
for (unsigned int i = 0; i < num_sectors; i++) {
bank->sectors[i].offset = i * sector_length;
bank->sectors[i].size = sector_length;
bank->sectors[i].is_erased = -1;