]> sigrok.org Git - libsigrok.git/commitdiff
gwinstek-gpd: Fix use of uninitialized variable
authorAndreas Sandberg <redacted>
Wed, 25 Mar 2020 09:16:31 +0000 (09:16 +0000)
committerUwe Hermann <redacted>
Sat, 4 Apr 2020 20:24:26 +0000 (22:24 +0200)
Signed-off-by: Andreas Sandberg <redacted>
src/hardware/gwinstek-gpd/api.c

index ac2fe2e17409d8567a6e765f08a35119c826df3a..3234240fddbb65492ddc4307d7526fde2f7886f4 100644 (file)
@@ -220,7 +220,7 @@ error:
 static int config_get(uint32_t key, GVariant **data,
        const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
-       int ret, channel;
+       int channel;
        const struct dev_context *devc;
        const struct sr_channel *ch;
 
@@ -244,7 +244,6 @@ static int config_get(uint32_t key, GVariant **data,
        } else {
                ch = cg->channels->data;
                channel = ch->index;
-               ret = SR_OK;
                switch (key) {
                case SR_CONF_VOLTAGE:
                        *data = g_variant_new_double(
@@ -267,7 +266,7 @@ static int config_get(uint32_t key, GVariant **data,
                }
        }
 
-       return ret;
+       return SR_OK;
 }
 
 static int config_set(uint32_t key, GVariant *data,