diff options
author | Marc Schink <dev@zapb.de> | 2020-06-07 17:00:13 +0200 |
---|---|---|
committer | Tomas Vanek <vanekt@fbl.cz> | 2020-07-07 05:23:54 +0100 |
commit | ef14384b681af4f731f768bb866457832af6925f (patch) | |
tree | a8cb953d765484d4cd627eaa7ea71d9be6699866 /src/flash/nor/avrf.c | |
parent | a2e6982a1816a0229bd5644156f3025a0e8cb6ce (diff) | |
download | riscv-openocd-ef14384b681af4f731f768bb866457832af6925f.zip riscv-openocd-ef14384b681af4f731f768bb866457832af6925f.tar.gz riscv-openocd-ef14384b681af4f731f768bb866457832af6925f.tar.bz2 |
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>
Diffstat (limited to 'src/flash/nor/avrf.c')
-rw-r--r-- | src/flash/nor/avrf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/flash/nor/avrf.c b/src/flash/nor/avrf.c index 93f6872..4ec1161 100644 --- a/src/flash/nor/avrf.c +++ b/src/flash/nor/avrf.c @@ -218,7 +218,8 @@ FLASH_BANK_COMMAND_HANDLER(avrf_flash_bank_command) return ERROR_OK; } -static int avrf_erase(struct flash_bank *bank, int first, int last) +static int avrf_erase(struct flash_bank *bank, unsigned int first, + unsigned int last) { struct target *target = bank->target; struct avr_common *avr = target->arch_info; @@ -442,7 +443,7 @@ COMMAND_HANDLER(avrf_handle_mass_erase_command) if (avrf_mass_erase(bank) == ERROR_OK) { /* set all sectors as erased */ - for (int i = 0; i < bank->num_sectors; i++) + for (unsigned int i = 0; i < bank->num_sectors; i++) bank->sectors[i].is_erased = 1; command_print(CMD, "avr mass erase complete"); |