From: Uwe Hermann Date: Wed, 10 Jan 2018 21:16:37 +0000 (+0100) Subject: hantek-dso: config_set(): Shorten SR_CONF_CAPTURE_RATIO case. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=04069272b4ded92dd198d39d6f268a6695b24a3f;p=libsigrok.git hantek-dso: config_set(): Shorten SR_CONF_CAPTURE_RATIO case. The sr_config_set() wrapper already checks for SR_CONF_CAPTURE_RATIO being 0..100. --- diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index 8d3e037e..48beebfc 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -506,7 +506,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { struct dev_context *devc; - int rat; int ch_idx, idx; float flt; @@ -532,12 +531,7 @@ static int config_set(uint32_t key, GVariant *data, devc->triggerslope = idx; break; case SR_CONF_CAPTURE_RATIO: - rat = g_variant_get_uint64(data); - if (rat < 0 || rat > 100) { - sr_err("Capture ratio must be in [0,100]."); - return SR_ERR_ARG; - } else - devc->capture_ratio = rat; + devc->capture_ratio = g_variant_get_uint64(data); break; case SR_CONF_BUFFERSIZE: if ((idx = std_u64_idx(data, devc->profile->buffersizes, NUM_BUFFER_SIZES)) < 0)