jtag/drivers/openjtag: fix clang static analyzer warnings

Change-Id: I900ce8157b3e220a4647871080bb9abc772446d1
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5369
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
This commit is contained in:
Tomas Vanek 2019-12-20 23:33:55 +01:00
parent 6ff852e415
commit b07604cc6a
1 changed files with 2 additions and 3 deletions

View File

@ -229,7 +229,7 @@ static int openjtag_buf_write_standard(
return ERROR_JTAG_DEVICE_ERROR; return ERROR_JTAG_DEVICE_ERROR;
} }
*bytes_written += retval; *bytes_written = retval;
return ERROR_OK; return ERROR_OK;
} }
@ -652,7 +652,6 @@ static void openjtag_add_scan(uint8_t *buffer, int length, struct scan_command *
/* whole byte */ /* whole byte */
/* bits to transfer */ /* bits to transfer */
bits = 7;
command |= (7 << 5); command |= (7 << 5);
length -= 8; length -= 8;
} }
@ -690,7 +689,7 @@ static void openjtag_execute_sleep(struct jtag_command *cmd)
static void openjtag_set_state(uint8_t openocd_state) static void openjtag_set_state(uint8_t openocd_state)
{ {
int8_t state = openjtag_get_tap_state(openocd_state); uint8_t state = openjtag_get_tap_state(openocd_state);
uint8_t buf = 0; uint8_t buf = 0;
buf = 0x01; buf = 0x01;