drivers: ch347: fix scan-build warnings

The newly merged driver ch347 triggers two new scan-build warnings
about dead assignment to variables.

Fix them.

Change-Id: Ided14272c3573be1498584e68ac4653cde029f31
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 7d0e125896 ("jtag/drivers: Add support for CH347-based JTAG adapters")
Reviewed-on: https://review.openocd.org/c/openocd/+/9094
Tested-by: jenkins
Reviewed-by: Matthias Jentsch <info@easydevkits.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Antonio Borneo
2025-08-24 12:30:52 +02:00
committed by Tomas Vanek
parent 56d67dac2e
commit 96c219a408

View File

@@ -863,7 +863,6 @@ static int ch347_single_read_get_byte(int read_buf_idx, uint8_t *byte)
if (read_buf_idx > CH347_SINGLE_CMD_MAX_READ || read_buf_idx < 0) {
LOG_ERROR("read_buf_idx out of range");
read_buf_idx = 0;
return ERROR_FAIL;
}
@@ -989,7 +988,6 @@ static int ch347_scratchpad_add_stableclocks(int count)
}
bool tms = ch347.tms_pin == TMS_H;
retval = ERROR_OK;
for (int i = 0; i < count; i++) {
retval = ch347_scratchpad_add_clock_tms(tms);
if (retval != ERROR_OK)