diff options
author | Marc Schink <dev@zapb.de> | 2020-07-01 10:21:06 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2020-07-08 22:05:27 +0100 |
commit | 8fc00a38bc54ce6f42d0ed1d9dc3588e58bbb73e (patch) | |
tree | f423a7dc0b4f935811ab115b497e162ef4ec48c3 /src | |
parent | 70f69f872857fd94ed252088d00e071e57d07b39 (diff) | |
download | riscv-openocd-8fc00a38bc54ce6f42d0ed1d9dc3588e58bbb73e.zip riscv-openocd-8fc00a38bc54ce6f42d0ed1d9dc3588e58bbb73e.tar.gz riscv-openocd-8fc00a38bc54ce6f42d0ed1d9dc3588e58bbb73e.tar.bz2 |
flash/nor/ambiqmicro: Use 'bool' data type
Change-Id: Ia8492905dc506d518266343d699c3245efbc1ab1
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/5733
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/flash/nor/ambiqmicro.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/flash/nor/ambiqmicro.c b/src/flash/nor/ambiqmicro.c index 1e2a4b1..622943d 100644 --- a/src/flash/nor/ambiqmicro.c +++ b/src/flash/nor/ambiqmicro.c @@ -92,7 +92,7 @@ static const uint32_t apollo_sram_size[] = { struct ambiqmicro_flash_bank { /* chip id register */ - uint32_t probed; + bool probed; const char *target_name; uint8_t target_class; @@ -156,7 +156,7 @@ FLASH_BANK_COMMAND_HANDLER(ambiqmicro_flash_bank_command) ambiqmicro_info->target_name = "Unknown target"; /* part wasn't probed yet */ - ambiqmicro_info->probed = 0; + ambiqmicro_info->probed = false; return ERROR_OK; } @@ -167,7 +167,7 @@ static int get_ambiqmicro_info(struct flash_bank *bank, char *buf, int buf_size) int printed; char *classname; - if (ambiqmicro_info->probed == 0) { + if (!ambiqmicro_info->probed) { LOG_ERROR("Target not probed"); return ERROR_FLASH_BANK_NOT_PROBED; } @@ -280,7 +280,7 @@ static int ambiqmicro_protect_check(struct flash_bank *bank) uint32_t i; - if (ambiqmicro->probed == 0) { + if (!ambiqmicro->probed) { LOG_ERROR("Target not probed"); return ERROR_FLASH_BANK_NOT_PROBED; } @@ -371,7 +371,7 @@ static int ambiqmicro_mass_erase(struct flash_bank *bank) return ERROR_TARGET_NOT_HALTED; } - if (ambiqmicro_info->probed == 0) { + if (!ambiqmicro_info->probed) { LOG_ERROR("Target not probed"); return ERROR_FLASH_BANK_NOT_PROBED; } @@ -439,7 +439,7 @@ static int ambiqmicro_erase(struct flash_bank *bank, unsigned int first, return ERROR_TARGET_NOT_HALTED; } - if (ambiqmicro_info->probed == 0) { + if (!ambiqmicro_info->probed) { LOG_ERROR("Target not probed"); return ERROR_FLASH_BANK_NOT_PROBED; } @@ -659,7 +659,7 @@ static int ambiqmicro_probe(struct flash_bank *bank) /* If this is a ambiqmicro chip, it has flash; probe() is just * to figure out how much is present. Only do it once. */ - if (ambiqmicro_info->probed == 1) { + if (ambiqmicro_info->probed) { LOG_INFO("Target already probed"); return ERROR_OK; } @@ -691,7 +691,7 @@ static int ambiqmicro_probe(struct flash_bank *bank) /* * Part has been probed. */ - ambiqmicro_info->probed = 1; + ambiqmicro_info->probed = true; return retval; } @@ -711,7 +711,7 @@ static int ambiqmicro_otp_program(struct flash_bank *bank, return ERROR_TARGET_NOT_HALTED; } - if (ambiqmicro_info->probed == 0) { + if (!ambiqmicro_info->probed) { LOG_ERROR("Target not probed"); return ERROR_FLASH_BANK_NOT_PROBED; } |