X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fserial_bt.c;h=8ed4523b8167ee1f42686d1ff9309f3b0f9c8c8f;hb=bf6b9e7b16264d2a6ccb3ac2a6004cbc2cef0e43;hp=37a1a68b0ad2147d5b540c10b49ec53773fcb59f;hpb=b79c3422789d181ad47d4a3707d18d7feea73b5d;p=libsigrok.git diff --git a/src/serial_bt.c b/src/serial_bt.c index 37a1a68b..8ed4523b 100644 --- a/src/serial_bt.c +++ b/src/serial_bt.c @@ -494,10 +494,8 @@ static int ser_bt_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 @@ -766,9 +764,8 @@ static void scan_cb(void *cb_args, const char *addr, const char *name) /* Check whether the device was seen before. */ for (l = scan_args->addr_list; l; l = l->next) { - if (strcmp(addr, l->data) == 0) { + if (strcmp(addr, l->data) == 0) return; - } } /* Substitute colons in the address by dashes. */