]> sigrok.org Git - libsigrok.git/commitdiff
kingst-la2016: Use ARRAY_SIZE.
authorUwe Hermann <redacted>
Sat, 6 Jun 2020 22:47:46 +0000 (00:47 +0200)
committerUwe Hermann <redacted>
Sat, 6 Jun 2020 22:48:29 +0000 (00:48 +0200)
src/hardware/kingst-la2016/api.c

index 6706c11c881701429bcaeff40fc1d888047c04e5..c919dbf04f78363c9a4de89ecdd0a49ff1d4d9ae 100644 (file)
@@ -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;