From: OpenOCD-Gerrit <ope...@us...> - 2020-02-24 10:27:08
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 066aa24e85532b555e1fd34850327e7f7a570bf8 (commit) from 98e9d96239af353bca3bad1bf5f4c809e8cc843b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 066aa24e85532b555e1fd34850327e7f7a570bf8 Author: Marc Schink <de...@za...> Date: Mon Feb 10 15:37:45 2020 +0100 flash/nor/stm32l4x: Minor code cleanups Change-Id: I3053bbe888ac1f0a0593ef51bf9ca564f1cc27ec Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/5449 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tar...@gm...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c index e9fb77e03..abbb75b46 100644 --- a/src/flash/nor/stm32l4x.c +++ b/src/flash/nor/stm32l4x.c @@ -142,7 +142,7 @@ struct stm32l4_part_info { }; struct stm32l4_flash_bank { - int probed; + bool probed; uint32_t idcode; int bank1_sectors; bool dual_bank_mode; @@ -282,7 +282,7 @@ FLASH_BANK_COMMAND_HANDLER(stm32l4_flash_bank_command) * Ask the flash infrastructure to ensure required alignment */ bank->write_start_alignment = bank->write_end_alignment = 8; - stm32l4_info->probed = 0; + stm32l4_info->probed = false; return ERROR_OK; } @@ -725,12 +725,11 @@ static int stm32l4_probe(struct flash_bank *bank) struct target *target = bank->target; struct stm32l4_flash_bank *stm32l4_info = bank->driver_priv; const struct stm32l4_part_info *part_info; - int i; uint16_t flash_size_in_kb = 0xffff; uint32_t device_id; uint32_t options; - stm32l4_info->probed = 0; + stm32l4_info->probed = false; /* read stm32 device id register */ int retval = stm32l4_read_idcode(bank, &stm32l4_info->idcode); @@ -875,7 +874,7 @@ static int stm32l4_probe(struct flash_bank *bank) return ERROR_FAIL; } - for (i = 0; i < bank->num_sectors; i++) { + for (int i = 0; i < bank->num_sectors; i++) { bank->sectors[i].offset = i * page_size; /* in dual bank configuration, if there is a gap between banks * we fix up the sector offset to consider this gap */ @@ -886,7 +885,7 @@ static int stm32l4_probe(struct flash_bank *bank) bank->sectors[i].is_protected = 1; } - stm32l4_info->probed = 1; + stm32l4_info->probed = true; return ERROR_OK; } @@ -976,8 +975,6 @@ err_lock: COMMAND_HANDLER(stm32l4_handle_mass_erase_command) { - int i; - if (CMD_ARGC < 1) { command_print(CMD, "stm32l4x mass_erase <STM32L4 bank>"); return ERROR_COMMAND_SYNTAX_ERROR; @@ -991,7 +988,7 @@ COMMAND_HANDLER(stm32l4_handle_mass_erase_command) retval = stm32l4_mass_erase(bank); if (retval == ERROR_OK) { /* set all sectors as erased */ - for (i = 0; i < bank->num_sectors; i++) + for (int i = 0; i < bank->num_sectors; i++) bank->sectors[i].is_erased = 1; command_print(CMD, "stm32l4x mass erase complete"); ----------------------------------------------------------------------- Summary of changes: src/flash/nor/stm32l4x.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) hooks/post-receive -- Main OpenOCD repository |