From: Uwe Hermann Date: Tue, 5 Jun 2018 21:14:51 +0000 (+0200) Subject: hantek-4032l: config_set(): Simplify SR_CONF_CAPTURE_RATIO case. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=583fc126d0b1a249c51d46216055b13e003fd340;p=libsigrok.git hantek-4032l: config_set(): Simplify SR_CONF_CAPTURE_RATIO case. The sr_config_set() wrapper already checks the value. --- diff --git a/src/hardware/hantek-4032l/api.c b/src/hardware/hantek-4032l/api.c index 5242a76e..14cd59f3 100644 --- a/src/hardware/hantek-4032l/api.c +++ b/src/hardware/hantek-4032l/api.c @@ -393,7 +393,7 @@ static int config_set(uint32_t key, GVariant *data, int idx; struct dev_context *devc = sdi->priv; struct h4032l_cmd_pkt *cmd_pkt = &devc->cmd_pkt; - uint64_t sample_rate, capture_ratio, number_samples; + uint64_t sample_rate, number_samples; double low, high, threshold; switch (key) { @@ -409,12 +409,7 @@ static int config_set(uint32_t key, GVariant *data, devc->sample_rate = idx; break; case SR_CONF_CAPTURE_RATIO: - capture_ratio = g_variant_get_uint64(data); - if (capture_ratio > 99) { - sr_err("Invalid capture ratio."); - return SR_ERR; - } - devc->capture_ratio = capture_ratio; + devc->capture_ratio = g_variant_get_uint64(data); break; case SR_CONF_LIMIT_SAMPLES: number_samples = g_variant_get_uint64(data);