Drop unneeded variables and checks (performed by the wrappers already).
ret = sigma_set_samplerate(sdi, g_variant_get_uint64(data));
break;
case SR_CONF_LIMIT_MSEC:
- tmp = g_variant_get_uint64(data);
- if (tmp > 0)
- devc->limit_msec = g_variant_get_uint64(data);
- else
- ret = SR_ERR;
+ devc->limit_msec = g_variant_get_uint64(data);
break;
case SR_CONF_LIMIT_SAMPLES:
tmp = g_variant_get_uint64(data);
const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
{
struct dev_context *devc;
- uint64_t tmp_u64;
int tmp, ret, idx;
(void)cg;
ret = SR_OK;
switch (key) {
case SR_CONF_LIMIT_SAMPLES:
- tmp_u64 = g_variant_get_uint64(data);
- devc->limit_samples = tmp_u64;
- ret = SR_OK;
+ devc->limit_samples = g_variant_get_uint64(data);
break;
case SR_CONF_DATALOG:
ret = cem_dt_885x_recording_set(sdi, g_variant_get_boolean(data));
return SR_ERR;
break;
case SR_CONF_LIMIT_MSEC:
- if (g_variant_get_uint64(data) == 0)
- return SR_ERR_ARG;
devc->limit_msec = g_variant_get_uint64(data);
break;
case SR_CONF_LIMIT_SAMPLES:
- if (g_variant_get_uint64(data) == 0)
- return SR_ERR_ARG;
devc->limit_samples = g_variant_get_uint64(data);
break;
default:
/* TODO: Implement. */
return SR_ERR_NA;
case SR_CONF_LIMIT_SAMPLES:
- if (g_variant_get_uint64(data) == 0)
- return SR_ERR_ARG;
devc->limit_samples = g_variant_get_uint64(data);
break;
case SR_CONF_SAMPLERATE:
/* Nothing to do, the ScanaPLUS samplerate is always 100MHz. */
break;
case SR_CONF_LIMIT_MSEC:
- if (g_variant_get_uint64(data) == 0)
- return SR_ERR_ARG;
devc->limit_msec = g_variant_get_uint64(data);
break;
case SR_CONF_LIMIT_SAMPLES:
- if (g_variant_get_uint64(data) == 0)
- return SR_ERR_ARG;
devc->limit_samples = g_variant_get_uint64(data);
break;
default:
switch (key) {
case SR_CONF_LIMIT_SAMPLES:
devc->limit_samples = g_variant_get_uint64(data);
- sr_dbg("Setting sample limit to %" PRIu64 ".",
- devc->limit_samples);
break;
case SR_CONF_SAMPLE_INTERVAL:
if ((idx = std_u64_tuple_idx(data, ARRAY_AND_SIZE(kecheng_kc_330b_sample_intervals))) < 0)
const struct sr_channel_group *cg)
{
struct dev_context *devc;
- uint64_t tmp_u64;
int ret, idx;
(void)cg;
ret = SR_OK;
switch (key) {
case SR_CONF_LIMIT_SAMPLES:
- tmp_u64 = g_variant_get_uint64(data);
- devc->limit_samples = tmp_u64;
- ret = SR_OK;
+ devc->limit_samples = g_variant_get_uint64(data);
break;
case SR_CONF_SPL_WEIGHT_FREQ:
if ((idx = std_str_idx(data, ARRAY_AND_SIZE(weight_freq))) < 0)
const char *opstr;
if (sdi && cg)
- suffix = " for this device and channel group";
+ suffix = " for this device instance and channel group";
else if (sdi)
- suffix = " for this device";
+ suffix = " for this device instance";
else
suffix = "";