X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fikalogic-scanalogic2%2Fapi.c;h=070357b3fc5bee267b896135d4de12125145d63f;hb=f3f19d1131025b68d29a11273b627c83d748e7ea;hp=97a733a18e194d105838e9486a4fc4f18b52c04b;hpb=4f840ce965b1c30c5ab75afecc56193cbaf5c1b3;p=libsigrok.git diff --git a/src/hardware/ikalogic-scanalogic2/api.c b/src/hardware/ikalogic-scanalogic2/api.c index 97a733a1..070357b3 100644 --- a/src/hardware/ikalogic-scanalogic2/api.c +++ b/src/hardware/ikalogic-scanalogic2/api.c @@ -47,9 +47,8 @@ SR_PRIV const uint64_t sl2_samplerates[NUM_SAMPLERATES] = { SR_MHZ(20), }; -static const char *channel_names[NUM_CHANNELS + 1] = { +static const char *channel_names[] = { "0", "1", "2", "3", - NULL, }; SR_PRIV struct sr_dev_driver ikalogic_scanalogic2_driver_info; @@ -67,7 +66,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) struct dev_context *devc; struct sr_usb_dev_inst *usb; struct device_info dev_info; - int ret, i; + unsigned int i; + int ret; (void)options; @@ -117,9 +117,9 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi->inst_type = SR_INST_USB; sdi->conn = usb; - for (i = 0; channel_names[i]; i++) - devc->channels[i] = sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, - TRUE, channel_names[i]); + for (i = 0; i < ARRAY_SIZE(channel_names); i++) + devc->channels[i] = sr_channel_new(sdi, i, + SR_CHANNEL_LOGIC, TRUE, channel_names[i]); devc->state = STATE_IDLE; devc->next_state = STATE_IDLE; @@ -354,7 +354,6 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * (void)cg; ret = SR_OK; - switch (key) { case SR_CONF_DEVICE_OPTIONS: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,