From: Uwe Hermann Date: Tue, 5 Jun 2018 21:55:23 +0000 (+0200) Subject: hantek-4032l: Use MIN() where possible. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=264a4cb2b875560d7c1fd4da7db80b01dad4177b;p=libsigrok.git hantek-4032l: Use MIN() where possible. --- diff --git a/src/hardware/hantek-4032l/protocol.c b/src/hardware/hantek-4032l/protocol.c index 9bebd61a..a3b41858 100644 --- a/src/hardware/hantek-4032l/protocol.c +++ b/src/hardware/hantek-4032l/protocol.c @@ -187,8 +187,7 @@ void LIBUSB_CALL h4032l_data_transfer_callback(struct libusb_transfer *transfer) buffer = (uint32_t *)transfer->buffer; - number_samples = (devc->remaining_samples < max_samples) ? - devc->remaining_samples : max_samples; + number_samples = MIN(devc->remaining_samples, max_samples); devc->remaining_samples -= number_samples; send_data(sdi, buffer, number_samples); sr_dbg("Remaining: %d %08X %08X.", devc->remaining_samples, @@ -289,8 +288,7 @@ void LIBUSB_CALL h4032l_usb_callback(struct libusb_transfer *transfer) buffer++; /* Fallthrough. */ case H4032L_STATUS_TRANSFER: - number_samples = (devc->remaining_samples < max_samples) ? - devc->remaining_samples : max_samples; + number_samples = MIN(devc->remaining_samples, max_samples); devc->remaining_samples -= number_samples; send_data(sdi, buffer, number_samples); sr_dbg("Remaining: %d %08X %08X.", devc->remaining_samples,