aboutsummaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2023-03-27 13:01:20 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2023-05-27 06:41:17 +0000
commitda76f8f0b4b98c2b7f04b5fe94f721aed7b2cfab (patch)
tree018448753dae9e0e69a13c130d60d62f9d45baa3 /src/flash
parentfe6befbd80fa806749b81d5d2deafdb4b8bf0cd8 (diff)
downloadriscv-openocd-da76f8f0b4b98c2b7f04b5fe94f721aed7b2cfab.zip
riscv-openocd-da76f8f0b4b98c2b7f04b5fe94f721aed7b2cfab.tar.gz
riscv-openocd-da76f8f0b4b98c2b7f04b5fe94f721aed7b2cfab.tar.bz2
target: use unsigned int for timeout_ms
Change the prototype of functions: - target_run_algorithm() - target_wait_algorithm() - target_wait_state() - struct target_type::run_algorithm() - struct target_type::wait_algorithm() to use unsigned int for timeout_ms instead of int. Change accordingly the variables passed as parameter. Change-Id: I0b8d6e691bb3c749eeb2911dc5a86c38cc0cb65d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7562 Tested-by: jenkins
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/nor/rp2040.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/flash/nor/rp2040.c b/src/flash/nor/rp2040.c
index 6c18c7b..b2ebd9c 100644
--- a/src/flash/nor/rp2040.c
+++ b/src/flash/nor/rp2040.c
@@ -91,7 +91,7 @@ static uint32_t rp2040_lookup_symbol(struct target *target, uint32_t tag, uint16
}
static int rp2040_call_rom_func(struct target *target, struct rp2040_flash_bank *priv,
- uint16_t func_offset, uint32_t argdata[], unsigned int n_args, int timeout_ms)
+ uint16_t func_offset, uint32_t argdata[], unsigned int n_args, unsigned int timeout_ms)
{
char *regnames[4] = { "r0", "r1", "r2", "r3" };
@@ -312,7 +312,7 @@ static int rp2040_flash_erase(struct flash_bank *bank, unsigned int first, unsig
an optional larger "block" (size and command provided in args).
*/
- int timeout_ms = 2000 * (last - first) + 1000;
+ unsigned int timeout_ms = 2000 * (last - first) + 1000;
err = rp2040_call_rom_func(target, priv, priv->jump_flash_range_erase,
args, ARRAY_SIZE(args), timeout_ms);