From: Uwe Hermann Date: Sat, 18 Feb 2012 11:16:49 +0000 (+0100) Subject: sr: Remove unneeded temp. variable use. X-Git-Tag: libsigrok-0.1.0~106 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=ee61b340da0bf4f0eb728c375459388c6a7bfd84;p=libsigrok.git sr: Remove unneeded temp. variable use. --- diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 8a947c10..67614c1d 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -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); } diff --git a/hardware/openbench-logic-sniffer/ols.c b/hardware/openbench-logic-sniffer/ols.c index 88891c08..a4013826 100644 --- a/hardware/openbench-logic-sniffer/ols.c +++ b/hardware/openbench-logic-sniffer/ols.c @@ -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; diff --git a/hardware/saleae-logic/saleae-logic.c b/hardware/saleae-logic/saleae-logic.c index 33707639..cf4b600d 100644 --- a/hardware/saleae-logic/saleae-logic.c +++ b/hardware/saleae-logic/saleae-logic.c @@ -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; diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index 79edc6de..4accf20c 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -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;