diff options
Diffstat (limited to 'src/flash/nor/numicro.c')
-rw-r--r-- | src/flash/nor/numicro.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/flash/nor/numicro.c b/src/flash/nor/numicro.c index a485282..c212cbc 100644 --- a/src/flash/nor/numicro.c +++ b/src/flash/nor/numicro.c @@ -1433,7 +1433,7 @@ static int numicro_protect_check(struct flash_bank *bank) { struct target *target = bank->target; uint32_t set, config[2]; - int i, retval = ERROR_OK; + int retval = ERROR_OK; if (target->state != TARGET_HALTED) { LOG_ERROR("Target not halted"); @@ -1467,25 +1467,26 @@ static int numicro_protect_check(struct flash_bank *bank) set = 0; } - for (i = 0; i < bank->num_sectors; i++) + for (unsigned int i = 0; i < bank->num_sectors; i++) bank->sectors[i].is_protected = set; return ERROR_OK; } -static int numicro_erase(struct flash_bank *bank, int first, int last) +static int numicro_erase(struct flash_bank *bank, unsigned int first, + unsigned int last) { struct target *target = bank->target; uint32_t timeout, status; - int i, retval = ERROR_OK; + int retval = ERROR_OK; if (target->state != TARGET_HALTED) { LOG_ERROR("Target not halted"); return ERROR_TARGET_NOT_HALTED; } - LOG_INFO("Nuvoton NuMicro: Sector Erase ... (%d to %d)", first, last); + LOG_INFO("Nuvoton NuMicro: Sector Erase ... (%u to %u)", first, last); retval = numicro_init_isp(target); if (retval != ERROR_OK) @@ -1495,8 +1496,8 @@ static int numicro_erase(struct flash_bank *bank, int first, int last) if (retval != ERROR_OK) return retval; - for (i = first; i <= last; i++) { - LOG_DEBUG("erasing sector %d at address " TARGET_ADDR_FMT, i, + for (unsigned int i = first; i <= last; i++) { + LOG_DEBUG("erasing sector %u at address " TARGET_ADDR_FMT, i, bank->base + bank->sectors[i].offset); retval = target_write_u32(target, NUMICRO_FLASH_ISPADR, bank->base + bank->sectors[i].offset); if (retval != ERROR_OK) |