aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2023-07-13 09:38:44 -0700
committerTomas Vanek <vanekt@fbl.cz>2023-07-24 07:27:24 +0000
commit7023deb06a8cac77fe50d341c9e34b80d4fc68fd (patch)
tree3ad53792973ac54e03329f5b5c93c2ac5aa81d5c /src
parent218f6c0181633057a892a8724c506b10b9f6afaa (diff)
downloadriscv-openocd-7023deb06a8cac77fe50d341c9e34b80d4fc68fd.zip
riscv-openocd-7023deb06a8cac77fe50d341c9e34b80d4fc68fd.tar.gz
riscv-openocd-7023deb06a8cac77fe50d341c9e34b80d4fc68fd.tar.bz2
jtag/drivers/xds110: Fix compiler warning.
Compiler would complain that `written` was used without being initialized. Simplify the code a little. The number of bytes written is already checked in usb_write(). Signed-off-by: Tim Newsome <tim@sifive.com> Change-Id: Ibada85dcccfca6f1269c584cdbc4f2e3b93bb8f3 Reviewed-on: https://review.openocd.org/c/openocd/+/7813 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Diffstat (limited to 'src')
-rw-r--r--src/jtag/drivers/xds110.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c
index 371dc88..717295c 100644
--- a/src/jtag/drivers/xds110.c
+++ b/src/jtag/drivers/xds110.c
@@ -579,9 +579,6 @@ static bool usb_get_response(uint32_t *total_bytes_read, uint32_t timeout)
static bool usb_send_command(uint16_t size)
{
- int written;
- bool success = true;
-
/* Check the packet length */
if (size > USB_PAYLOAD_SIZE)
return false;
@@ -596,13 +593,7 @@ static bool usb_send_command(uint16_t size)
size += 3;
/* Send the data via the USB connection */
- success = usb_write(xds110.write_packet, (int)size, &written);
-
- /* Check if the correct number of bytes was written */
- if (written != (int)size)
- success = false;
-
- return success;
+ return usb_write(xds110.write_packet, (int)size, NULL);
}
/***************************************************************************