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;
|
tmp[1] |= 0x80;
|
||||||
|
|
||||||
sigma_write_register(WRITE_TRIGGER_SELECT0, tmp, sizeof(tmp),
|
sigma_write_register(WRITE_TRIGGER_SELECT0, tmp, sizeof(tmp),
|
||||||
sigma);
|
sigma);
|
||||||
sigma_set_register(WRITE_TRIGGER_SELECT1, 0x30 | i, 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) {
|
switch (hwcap) {
|
||||||
case SR_HWCAP_SAMPLERATE:
|
case SR_HWCAP_SAMPLERATE:
|
||||||
tmp_u64 = value;
|
ret = set_samplerate(sdi, *(uint64_t *)value);
|
||||||
ret = set_samplerate(sdi, *tmp_u64);
|
|
||||||
break;
|
break;
|
||||||
case SR_HWCAP_PROBECONFIG:
|
case SR_HWCAP_PROBECONFIG:
|
||||||
ret = configure_probes(ols, (GSList *) value);
|
ret = configure_probes(ols, (GSList *)value);
|
||||||
break;
|
break;
|
||||||
case SR_HWCAP_LIMIT_SAMPLES:
|
case SR_HWCAP_LIMIT_SAMPLES:
|
||||||
tmp_u64 = value;
|
tmp_u64 = value;
|
||||||
|
@ -670,8 +669,7 @@ static int hw_dev_config_set(int dev_index, int hwcap, void *value)
|
||||||
ret = SR_OK;
|
ret = SR_OK;
|
||||||
break;
|
break;
|
||||||
case SR_HWCAP_CAPTURE_RATIO:
|
case SR_HWCAP_CAPTURE_RATIO:
|
||||||
tmp_u64 = value;
|
ols->capture_ratio = *(uint64_t *)value;
|
||||||
ols->capture_ratio = *tmp_u64;
|
|
||||||
if (ols->capture_ratio < 0 || ols->capture_ratio > 100) {
|
if (ols->capture_ratio < 0 || ols->capture_ratio > 100) {
|
||||||
ols->capture_ratio = 0;
|
ols->capture_ratio = 0;
|
||||||
ret = SR_ERR;
|
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 sr_dev_inst *sdi;
|
||||||
struct fx2_dev *fx2;
|
struct fx2_dev *fx2;
|
||||||
int ret;
|
int ret;
|
||||||
uint64_t *tmp_u64;
|
|
||||||
|
|
||||||
if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
|
if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
fx2 = sdi->priv;
|
fx2 = sdi->priv;
|
||||||
|
|
||||||
if (hwcap == SR_HWCAP_SAMPLERATE) {
|
if (hwcap == SR_HWCAP_SAMPLERATE) {
|
||||||
tmp_u64 = value;
|
ret = set_samplerate(sdi, *(uint64_t *)value);
|
||||||
ret = set_samplerate(sdi, *tmp_u64);
|
|
||||||
} else if (hwcap == SR_HWCAP_PROBECONFIG) {
|
} else if (hwcap == SR_HWCAP_PROBECONFIG) {
|
||||||
ret = configure_probes(fx2, (GSList *) value);
|
ret = configure_probes(fx2, (GSList *) value);
|
||||||
} else if (hwcap == SR_HWCAP_LIMIT_SAMPLES) {
|
} else if (hwcap == SR_HWCAP_LIMIT_SAMPLES) {
|
||||||
tmp_u64 = value;
|
fx2->limit_samples = *(uint64_t *)value;
|
||||||
fx2->limit_samples = *tmp_u64;
|
|
||||||
ret = SR_OK;
|
ret = SR_OK;
|
||||||
} else {
|
} else {
|
||||||
ret = SR_ERR;
|
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)
|
static int hw_dev_config_set(int dev_index, int hwcap, void *value)
|
||||||
{
|
{
|
||||||
struct sr_dev_inst *sdi;
|
struct sr_dev_inst *sdi;
|
||||||
uint64_t *tmp_u64;
|
|
||||||
struct zp *zp;
|
struct zp *zp;
|
||||||
|
|
||||||
if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
|
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) {
|
switch (hwcap) {
|
||||||
case SR_HWCAP_SAMPLERATE:
|
case SR_HWCAP_SAMPLERATE:
|
||||||
tmp_u64 = value;
|
return set_samplerate(sdi, *(uint64_t *)value);
|
||||||
return set_samplerate(sdi, *tmp_u64);
|
|
||||||
case SR_HWCAP_PROBECONFIG:
|
case SR_HWCAP_PROBECONFIG:
|
||||||
return configure_probes(sdi, (GSList *)value);
|
return configure_probes(sdi, (GSList *)value);
|
||||||
case SR_HWCAP_LIMIT_SAMPLES:
|
case SR_HWCAP_LIMIT_SAMPLES:
|
||||||
tmp_u64 = value;
|
zp->limit_samples = *(uint64_t *)value;
|
||||||
zp->limit_samples = *tmp_u64;
|
|
||||||
return SR_OK;
|
return SR_OK;
|
||||||
default:
|
default:
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
Loading…
Reference in New Issue