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
This commit is contained in:
Antonio Borneo 2022-11-16 01:02:02 +01:00
parent 6ea1ccf3e6
commit 0f034868f2
1 changed files with 2 additions and 2 deletions

View File

@ -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) {