From: OpenOCD-Gerrit <ope...@us...> - 2021-04-22 12:07:23
|
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 41a6089504823433817ea67d9af3d2d85f402336 (commit) via dc277057f57780354278cdc4876d393735f49369 (commit) from ff755a575ebf0218c2eb8745eff8050f8f02a53d (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 41a6089504823433817ea67d9af3d2d85f402336 Author: Marc Schink <de...@za...> Date: Mon Apr 12 18:54:16 2021 +0200 flash/nor/nrf5: Fix data types and const correctness Change-Id: I8c5bac7098d92e9b3bd1b045735879cf32ac218d Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6163 Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins diff --git a/src/flash/nor/nrf5.c b/src/flash/nor/nrf5.c index 1784bcde5..12bbac64f 100644 --- a/src/flash/nor/nrf5.c +++ b/src/flash/nor/nrf5.c @@ -289,7 +289,7 @@ static const struct nrf5_device_package nrf5_packages_table[] = { const struct flash_driver nrf5_flash, nrf51_flash; -static int nrf5_bank_is_probed(struct flash_bank *bank) +static bool nrf5_bank_is_probed(const struct flash_bank *bank) { struct nrf5_bank *nbank = bank->driver_priv; @@ -309,13 +309,10 @@ static int nrf5_get_probed_chip_if_halted(struct flash_bank *bank, struct nrf5_i struct nrf5_bank *nbank = bank->driver_priv; *chip = nbank->chip; - int probed = nrf5_bank_is_probed(bank); - if (probed < 0) - return probed; - else if (!probed) - return nrf5_probe(bank); - else + if (nrf5_bank_is_probed(bank)) return ERROR_OK; + + return nrf5_probe(bank); } static int nrf5_wait_for_nvmc(struct nrf5_info *chip) @@ -872,14 +869,10 @@ static int nrf5_probe(struct flash_bank *bank) static int nrf5_auto_probe(struct flash_bank *bank) { - int probed = nrf5_bank_is_probed(bank); - - if (probed < 0) - return probed; - else if (probed) + if (nrf5_bank_is_probed(bank)) return ERROR_OK; - else - return nrf5_probe(bank); + + return nrf5_probe(bank); } static int nrf5_erase_all(struct nrf5_info *chip) commit dc277057f57780354278cdc4876d393735f49369 Author: Marc Schink <de...@za...> Date: Sun Apr 11 21:36:00 2021 +0200 flash/nor/numicro: Use 'bool' data type Change-Id: Ib4ee64dec9c1253ae45bc58e9f175ab36964180a Signed-off-by: Marc Schink <de...@za...> Reviewed-on: http://openocd.zylin.com/6162 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/flash/nor/numicro.c b/src/flash/nor/numicro.c index 1971daa24..d9ea16d27 100644 --- a/src/flash/nor/numicro.c +++ b/src/flash/nor/numicro.c @@ -1132,7 +1132,7 @@ static const struct numicro_cpu_type NuMicroParts[] = { /* Private bank information for NuMicro. */ struct numicro_flash_bank { struct working_area *write_algorithm; - int probed; + bool probed; const struct numicro_cpu_type *cpu; }; ----------------------------------------------------------------------- Summary of changes: src/flash/nor/nrf5.c | 21 +++++++-------------- src/flash/nor/numicro.c | 2 +- 2 files changed, 8 insertions(+), 15 deletions(-) hooks/post-receive -- Main OpenOCD repository |