diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2022-11-16 01:02:02 +0100 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2022-12-03 09:24:59 +0000 |
commit | 0f034868f2c90741e57c5e27121e292b1774c080 (patch) | |
tree | 6964906368a3f6c05323de8a3af830304d903200 /src/flash | |
parent | 6ea1ccf3e6dd84c600c4ae9fb70347872634ded4 (diff) | |
download | riscv-openocd-0f034868f2c90741e57c5e27121e292b1774c080.zip riscv-openocd-0f034868f2c90741e57c5e27121e292b1774c080.tar.gz riscv-openocd-0f034868f2c90741e57c5e27121e292b1774c080.tar.bz2 |
flash: lpc2900: fix clang error 'dead assignment'
The variable retval is assigned a value that is never used.
Scan-build reports:
Although the value stored to 'retval' is used in the
enclosing expression, the value is never actually read
from 'retval'.
Drop the dead assignment.
Change-Id: I11588dee748a55d52aa7f35bc1967b7df55af7fc
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7379
Tested-by: jenkins
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/nor/lpc2900.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/flash/nor/lpc2900.c b/src/flash/nor/lpc2900.c index c30fa76..948def9 100644 --- a/src/flash/nor/lpc2900.c +++ b/src/flash/nor/lpc2900.c @@ -1132,9 +1132,9 @@ static int lpc2900_write(struct flash_bank *bank, const uint8_t *buffer, * reduced size if that fails. */ struct working_area *warea; uint32_t buffer_size = lpc2900_info->max_ram_block - 1 * KiB; - while ((retval = target_alloc_working_area_try(target, + while (target_alloc_working_area_try(target, buffer_size + target_code_size, - &warea)) != ERROR_OK) { + &warea) != ERROR_OK) { /* Try a smaller buffer now, and stop if it's too small. */ buffer_size -= 1 * KiB; if (buffer_size < 2 * KiB) { |