From 0f034868f2c90741e57c5e27121e292b1774c080 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Wed, 16 Nov 2022 01:02:02 +0100 Subject: [PATCH] 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 Reviewed-on: https://review.openocd.org/c/openocd/+/7379 Tested-by: jenkins --- src/flash/nor/lpc2900.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flash/nor/lpc2900.c b/src/flash/nor/lpc2900.c index c30fa7637d..948def9829 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) { -- 2.30.2