]> sigrok.org Git - libsigrok.git/commitdiff
sr: Remove unneeded temp. variable use.
authorUwe Hermann <redacted>
Sat, 18 Feb 2012 11:16:49 +0000 (12:16 +0100)
committerUwe Hermann <redacted>
Sat, 18 Feb 2012 11:16:49 +0000 (12:16 +0100)
hardware/asix-sigma/asix-sigma.c
hardware/openbench-logic-sniffer/ols.c
hardware/saleae-logic/saleae-logic.c
hardware/zeroplus-logic-cube/zeroplus.c

index 8a947c10f15af683a640c22b65e62283a04e75f9..67614c1d1d92bd8b31cbd3ffd83f8eb45873c32d 100644 (file)
@@ -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),
                        tmp[1] |= 0x80;
 
                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);
        }
 
index 88891c089bdbe33cf3956d2393a5fea0845d9ace..a4013826963386ce4827554c4a39e2da04fa3a8a 100644 (file)
@@ -653,11 +653,10 @@ static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 
        switch (hwcap) {
        case SR_HWCAP_SAMPLERATE:
 
        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:
                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;
                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:
                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;
                if (ols->capture_ratio < 0 || ols->capture_ratio > 100) {
                        ols->capture_ratio = 0;
                        ret = SR_ERR;
index 33707639ac37f73506091f9605332d1e89a5b971..cf4b600d4b63f9dc9e2fe96104bc26b5b2d7b0e6 100644 (file)
@@ -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;
        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) {
 
        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) {
        } 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;
                ret = SR_OK;
        } else {
                ret = SR_ERR;
index 79edc6deb67654306809801eb92e4061f3b905c2..4accf20cdec9c35a4aa2a7692d0176bcd6f04e1a 100644 (file)
@@ -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;
 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))) {
        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:
 
        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:
        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;
                return SR_OK;
        default:
                return SR_ERR;