From: Uwe Hermann Date: Sat, 6 Jun 2020 22:47:46 +0000 (+0200) Subject: kingst-la2016: Use ARRAY_SIZE. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b2b6dd55ec41ec5220988a82b1177e39d123176d;p=libsigrok.git kingst-la2016: Use ARRAY_SIZE. --- diff --git a/src/hardware/kingst-la2016/api.c b/src/hardware/kingst-la2016/api.c index 6706c11c..c919dbf0 100644 --- a/src/hardware/kingst-la2016/api.c +++ b/src/hardware/kingst-la2016/api.c @@ -109,8 +109,6 @@ static const char *logic_threshold[] = { #define MAX_NUM_LOGIC_THRESHOLD_ENTRIES ARRAY_SIZE(logic_threshold) -#define array_length(a) (sizeof(a) / sizeof((a)[0])) - static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct drv_context *drvc; @@ -550,7 +548,7 @@ static void send_chunk(struct sr_dev_inst *sdi, transfer_packet_t *packets, unsi transfer_packet_host(packets[i]); packet = packets + i; ptotal = 0; - for (k = 0; k < array_length(packet->packet); k++) { + for (k = 0; k < ARRAY_SIZE(packet->packet); k++) { free_n_samples = max_samples - n_samples; if (free_n_samples < 256 || do_signal_trigger) { logic.length = n_samples * 2;