From: Andreas Sandberg Date: Wed, 25 Mar 2020 09:16:31 +0000 (+0000) Subject: gwinstek-gpd: Fix use of uninitialized variable X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5ff772410b732c650f281a55dd839d96d0f80ab1;p=libsigrok.git gwinstek-gpd: Fix use of uninitialized variable Signed-off-by: Andreas Sandberg --- diff --git a/src/hardware/gwinstek-gpd/api.c b/src/hardware/gwinstek-gpd/api.c index ac2fe2e1..3234240f 100644 --- a/src/hardware/gwinstek-gpd/api.c +++ b/src/hardware/gwinstek-gpd/api.c @@ -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,