Skip to content

Commit

Permalink
kingst-la2016: Use ARRAY_SIZE.
Browse files Browse the repository at this point in the history
  • Loading branch information
uwehermann committed Jun 6, 2020
1 parent f2cd2de commit b2b6dd5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/hardware/kingst-la2016/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b2b6dd5

Please sign in to comment.