sr: Remove unneeded temp. variable use.
This commit is contained in:
parent
a9a245b428
commit
ee61b340da
|
@ -309,7 +309,7 @@ static int sigma_write_trigger_lut(struct triggerlut *lut, struct sigma *sigma)
|
|||
tmp[1] |= 0x80;
|
||||
|
||||
sigma_write_register(WRITE_TRIGGER_SELECT0, tmp, sizeof(tmp),
|
||||
sigma);
|
||||
sigma);
|
||||
sigma_set_register(WRITE_TRIGGER_SELECT1, 0x30 | i, sigma);
|
||||
}
|
||||
|
||||
|
|
|
@ -653,11 +653,10 @@ static int hw_dev_config_set(int dev_index, int hwcap, void *value)
|
|||
|
||||
switch (hwcap) {
|
||||
case SR_HWCAP_SAMPLERATE:
|
||||
tmp_u64 = value;
|
||||
ret = set_samplerate(sdi, *tmp_u64);
|
||||
ret = set_samplerate(sdi, *(uint64_t *)value);
|
||||
break;
|
||||
case SR_HWCAP_PROBECONFIG:
|
||||
ret = configure_probes(ols, (GSList *) value);
|
||||
ret = configure_probes(ols, (GSList *)value);
|
||||
break;
|
||||
case SR_HWCAP_LIMIT_SAMPLES:
|
||||
tmp_u64 = value;
|
||||
|
@ -670,8 +669,7 @@ static int hw_dev_config_set(int dev_index, int hwcap, void *value)
|
|||
ret = SR_OK;
|
||||
break;
|
||||
case SR_HWCAP_CAPTURE_RATIO:
|
||||
tmp_u64 = value;
|
||||
ols->capture_ratio = *tmp_u64;
|
||||
ols->capture_ratio = *(uint64_t *)value;
|
||||
if (ols->capture_ratio < 0 || ols->capture_ratio > 100) {
|
||||
ols->capture_ratio = 0;
|
||||
ret = SR_ERR;
|
||||
|
|
|
@ -632,20 +632,17 @@ static int hw_dev_config_set(int dev_index, int hwcap, void *value)
|
|||
struct sr_dev_inst *sdi;
|
||||
struct fx2_dev *fx2;
|
||||
int ret;
|
||||
uint64_t *tmp_u64;
|
||||
|
||||
if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
|
||||
return SR_ERR;
|
||||
fx2 = sdi->priv;
|
||||
|
||||
if (hwcap == SR_HWCAP_SAMPLERATE) {
|
||||
tmp_u64 = value;
|
||||
ret = set_samplerate(sdi, *tmp_u64);
|
||||
ret = set_samplerate(sdi, *(uint64_t *)value);
|
||||
} else if (hwcap == SR_HWCAP_PROBECONFIG) {
|
||||
ret = configure_probes(fx2, (GSList *) value);
|
||||
} else if (hwcap == SR_HWCAP_LIMIT_SAMPLES) {
|
||||
tmp_u64 = value;
|
||||
fx2->limit_samples = *tmp_u64;
|
||||
fx2->limit_samples = *(uint64_t *)value;
|
||||
ret = SR_OK;
|
||||
} else {
|
||||
ret = SR_ERR;
|
||||
|
|
|
@ -599,7 +599,6 @@ static int set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate)
|
|||
static int hw_dev_config_set(int dev_index, int hwcap, void *value)
|
||||
{
|
||||
struct sr_dev_inst *sdi;
|
||||
uint64_t *tmp_u64;
|
||||
struct zp *zp;
|
||||
|
||||
if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
|
||||
|
@ -614,13 +613,11 @@ static int hw_dev_config_set(int dev_index, int hwcap, void *value)
|
|||
|
||||
switch (hwcap) {
|
||||
case SR_HWCAP_SAMPLERATE:
|
||||
tmp_u64 = value;
|
||||
return set_samplerate(sdi, *tmp_u64);
|
||||
return set_samplerate(sdi, *(uint64_t *)value);
|
||||
case SR_HWCAP_PROBECONFIG:
|
||||
return configure_probes(sdi, (GSList *)value);
|
||||
case SR_HWCAP_LIMIT_SAMPLES:
|
||||
tmp_u64 = value;
|
||||
zp->limit_samples = *tmp_u64;
|
||||
zp->limit_samples = *(uint64_t *)value;
|
||||
return SR_OK;
|
||||
default:
|
||||
return SR_ERR;
|
||||
|
|
Loading…
Reference in New Issue