]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/ikalogic-scanalogic2/api.c
Fix a bunch of typos.
[libsigrok.git] / src / hardware / ikalogic-scanalogic2 / api.c
index 97a733a18e194d105838e9486a4fc4f18b52c04b..070357b3fc5bee267b896135d4de12125145d63f 100644 (file)
@@ -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,