X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fserial_hid.c;fp=src%2Fserial_hid.c;h=ee073d1dbbb509d60d7d62cdc69975c9d90e3f4b;hb=bf6b9e7b16264d2a6ccb3ac2a6004cbc2cef0e43;hp=d2776fc7d79cf2f789d3d62939c3b7892e764132;hpb=c87e9d26f4e4d773a34f58b7c8752b1499adca50;p=libsigrok.git diff --git a/src/serial_hid.c b/src/serial_hid.c index d2776fc7..ee073d1d 100644 --- a/src/serial_hid.c +++ b/src/serial_hid.c @@ -635,9 +635,8 @@ SR_PRIV const char *ser_hid_chip_find_name_vid_pid(uint16_t vid, uint16_t pid) if (!vid_pids) continue; while (vid_pids->vid) { - if (vid_pids->vid == vid && vid_pids->pid == pid) { + if (vid_pids->vid == vid && vid_pids->pid == pid) return desc->chipname; - } vid_pids++; } } @@ -1298,10 +1297,8 @@ static int ser_hid_read(struct sr_serial_dev_inst *serial, * Immediately satisfy the caller's request from the RX buffer * if the requested amount of data is available already. */ - if (sr_ser_has_queued_data(serial) >= count) { - rc = sr_ser_unqueue_rx_data(serial, buf, count); - return rc; - } + if (sr_ser_has_queued_data(serial) >= count) + return sr_ser_unqueue_rx_data(serial, buf, count); /* * When a timeout was specified, then determine the deadline @@ -1387,9 +1384,8 @@ static int ser_hid_read(struct sr_serial_dev_inst *serial, if (got > count) got = count; sr_dbg("DBG: %s() passing %d bytes.", __func__, got); - rc = sr_ser_unqueue_rx_data(serial, buf, count); - return rc; + return sr_ser_unqueue_rx_data(serial, buf, count); } static struct ser_lib_functions serlib_hid = {