]> sigrok.org Git - libsigrok.git/commitdiff
drivers: Random whitespace fixes.
authorUwe Hermann <redacted>
Sun, 6 Aug 2017 14:42:35 +0000 (16:42 +0200)
committerUwe Hermann <redacted>
Sun, 6 Aug 2017 15:31:46 +0000 (17:31 +0200)
src/hardware/agilent-dmm/protocol.c
src/hardware/asix-sigma/protocol.c
src/hardware/baylibre-acme/protocol.c
src/hardware/demo/protocol.c
src/hardware/gmc-mh-1x-2x/protocol.c
src/hardware/teleinfo/protocol.c

index 8778c711c427ca9d07badd27017f0b54c4d302b4..23768a6a28c6f77c7e61f7f4cb2b1da151102689 100644 (file)
@@ -77,7 +77,7 @@ static const struct agdmm_job *job_next(struct dev_context *devc)
                devc->current_job++;
                if (!job_current(devc)->send)
                        devc->current_job = 0;
-       } while(job_in_interval(devc) && devc->current_job != current_job);
+       } while (job_in_interval(devc) && devc->current_job != current_job);
        return job_current(devc);
 }
 
@@ -626,7 +626,7 @@ static int recv_conf_u123x(const struct sr_dev_inst *sdi, GMatchInfo *match)
                } else if (!strcmp(mstr, "DC")) {
                        devc->cur_mqflags[i] |= SR_MQFLAG_DC;
                } else {
-               sr_dbg("Unknown first argument '%s'.", mstr);
+                       sr_dbg("Unknown first argument '%s'.", mstr);
                }
                g_free(mstr);
        } else
index 41c6dc878cba90fa460d8895548fa553bf527cbb..e2c34e5c9169699df381d5b8fecbbab3e8685849 100644 (file)
@@ -78,12 +78,11 @@ static int sigma_write(void *buf, size_t size, struct dev_context *devc)
        int ret;
 
        ret = ftdi_write_data(&devc->ftdic, (unsigned char *)buf, size);
-       if (ret < 0) {
+       if (ret < 0)
                sr_err("ftdi_write_data failed: %s",
                       ftdi_get_error_string(&devc->ftdic));
-       } else if ((size_t) ret != size) {
+       else if ((size_t) ret != size)
                sr_err("ftdi_write_data did not complete write.");
-       }
 
        return ret;
 }
@@ -646,16 +645,13 @@ SR_PRIV int sigma_convert_trigger(const struct sr_dev_inst *sdi)
                                if (match->match == SR_TRIGGER_ONE) {
                                        devc->trigger.simplevalue |= channelbit;
                                        devc->trigger.simplemask |= channelbit;
-                               }
-                               else if (match->match == SR_TRIGGER_ZERO) {
+                               } else if (match->match == SR_TRIGGER_ZERO) {
                                        devc->trigger.simplevalue &= ~channelbit;
                                        devc->trigger.simplemask |= channelbit;
-                               }
-                               else if (match->match == SR_TRIGGER_FALLING) {
+                               } else if (match->match == SR_TRIGGER_FALLING) {
                                        devc->trigger.fallingmask |= channelbit;
                                        trigger_set++;
-                               }
-                               else if (match->match == SR_TRIGGER_RISING) {
+                               } else if (match->match == SR_TRIGGER_RISING) {
                                        devc->trigger.risingmask |= channelbit;
                                        trigger_set++;
                                }
index a6ff339b77f3819b6e450eaf591fd36d0aac0ffb..17ae5b90859e764eb852439dadeab9314823cd64 100644 (file)
@@ -310,11 +310,11 @@ static int read_probe_eeprom(unsigned int addr, struct probe_eeprom *eeprom)
 static int revB_addr_to_num(unsigned int addr)
 {
        switch (addr) {
-       case 0x44:      return 5;
-       case 0x45:      return 6;
-       case 0x42:      return 3;
-       case 0x43:      return 4;
-       default:        return addr - 0x3f;
+       case 0x44: return 5;
+       case 0x45: return 6;
+       case 0x42: return 3;
+       case 0x43: return 4;
+       default:   return addr - 0x3f;
        }
 }
 
index 8b89d3548f8ce0fd3fb88ccb25c38733fc6deb1d..9969abf90f4171154751d48a4a239529e7507589 100644 (file)
@@ -273,9 +273,8 @@ static void logic_generator(struct sr_dev_inst *sdi, uint64_t size)
                break;
        case PATTERN_INC:
                for (i = 0; i < size; i++) {
-                       for (j = 0; j < devc->logic_unitsize; j++) {
+                       for (j = 0; j < devc->logic_unitsize; j++)
                                devc->logic_data[i + j] = devc->step;
-                       }
                        devc->step++;
                }
                break;
index 53efdf4255f7500d60c4f07ef36ac6e537f4dff3..7d06b07176fbfb0d52423460adbb9c026e91d6f7 100644 (file)
@@ -755,8 +755,7 @@ static void process_msg_inf_10(struct sr_dev_inst *sdi)
                dgt = bc(devc->buf[5 + cnt]);
                if (dgt == 11) { /* Empty digit */
                        dgt = 0;
-               }
-               else if (dgt >= 12) { /* Overload */
+               } else if (dgt >= 12) { /* Overload */
                        devc->value = NAN;
                        devc->scale = 0;
                        break;
@@ -953,8 +952,7 @@ static int chk_msg14(struct sr_dev_inst *sdi)
                        sr_err("Device: Unknown error code!");
                }
                retc = SR_ERR_ARG;
-       }
-       else if (!isreq && ((devc->buf[1] != 0x27) || (devc->buf[2] != 0x3f))) {
+       } else if (!isreq && ((devc->buf[1] != 0x27) || (devc->buf[2] != 0x3f))) {
                sr_err("process_msg_14(): byte 1/2 unexpected!");
                retc = SR_ERR_ARG;
        }
@@ -1055,11 +1053,9 @@ SR_PRIV int process_msg14(struct sr_dev_inst *sdi)
                                devc->value = NAN;
                                devc->scale = 0;
                                break;
-                       }
-                       else if (dgt == 13) { /* FUSE */
+                       } else if (dgt == 13) { /* FUSE */
                                sr_err("FUSE!");
-                       }
-                       else if (dgt == 14) { /* Function recognition mode, OPEN */
+                       } else if (dgt == 14) { /* Function recognition mode, OPEN */
                                sr_info("Function recognition mode, OPEN!");
                                devc->value = NAN;
                                devc->scale = 0;
@@ -1135,8 +1131,7 @@ SR_PRIV int gmc_mh_1x_2x_receive_data(int fd, int revents, void *cb_data)
                                        process_msg_inf_10(sdi);
                                        devc->buflen = 0;
                                        continue;
-                               }
-                               else if ((devc->buflen >= 5) &&
+                               } else if ((devc->buflen >= 5) &&
                                         (devc->buf[devc->buflen - 1] &
                                          MSGID_MASK) != MSGID_DATA) {
                                        /*
@@ -1144,8 +1139,7 @@ SR_PRIV int gmc_mh_1x_2x_receive_data(int fd, int revents, void *cb_data)
                                         * of next message.
                                         */
                                        process_msg_inf_5(sdi);
-                                       devc->buf[0] =
-                                                       devc->buf[devc->buflen - 1];
+                                       devc->buf[0] = devc->buf[devc->buflen - 1];
                                        devc->buflen = 1;
                                        continue;
                                }
@@ -1223,8 +1217,7 @@ SR_PRIV int gmc_mh_2x_receive_data(int fd, int revents, void *cb_data)
                        if (devc->cmd_seq % 10 == 0) {
                                if (req_stat14(sdi, FALSE) != SR_OK)
                                        return FALSE;
-                       }
-                       else if (req_meas14(sdi) != SR_OK)
+                       } else if (req_meas14(sdi) != SR_OK)
                                return FALSE;
                }
        }
index d42da22b5621466418e3ae66f4f3df0e58757bfd..c87ea8a1f10b37b55491600b6414617d5e3ec0fc 100644 (file)
@@ -96,35 +96,34 @@ static void teleinfo_handle_measurement(struct sr_dev_inst *sdi,
                return;
        }
 
-       if (!strcmp(label, "ADCO")) {
+       if (!strcmp(label, "ADCO"))
                sr_sw_limits_update_samples_read(&devc->sw_limits, 1);
-       } else if (!strcmp(label, "BASE")) {
+       else if (!strcmp(label, "BASE"))
                teleinfo_send_value(sdi, "BASE", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
-       } else if (!strcmp(label, "HCHP")) {
+       else if (!strcmp(label, "HCHP"))
                teleinfo_send_value(sdi, "HP"  , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
-       } else if (!strcmp(label, "HCHC")) {
+       else if (!strcmp(label, "HCHC"))
                teleinfo_send_value(sdi, "HC"  , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
-       } else if (!strcmp(label, "EJPHN")) {
+       else if (!strcmp(label, "EJPHN"))
                teleinfo_send_value(sdi, "HN"  , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
-       } else if (!strcmp(label, "EJPHPM")) {
+       else if (!strcmp(label, "EJPHPM"))
                teleinfo_send_value(sdi, "HPM" , v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
-       } else if (!strcmp(label, "BBRHPJB")) {
+       else if (!strcmp(label, "BBRHPJB"))
                teleinfo_send_value(sdi, "HPJB", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
-       } else if (!strcmp(label, "BBRHPJW")) {
+       else if (!strcmp(label, "BBRHPJW"))
                teleinfo_send_value(sdi, "HPJW", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
-       } else if (!strcmp(label, "BBRHPJR")) {
+       else if (!strcmp(label, "BBRHPJR"))
                teleinfo_send_value(sdi, "HPJR", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
-       } else if (!strcmp(label, "BBRHCJB")) {
+       else if (!strcmp(label, "BBRHCJB"))
                teleinfo_send_value(sdi, "HCJB", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
-       } else if (!strcmp(label, "BBRHCJW")) {
+       else if (!strcmp(label, "BBRHCJW"))
                teleinfo_send_value(sdi, "HCJW", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
-       } else if (!strcmp(label, "BBRHCJR")) {
+       else if (!strcmp(label, "BBRHCJR"))
                teleinfo_send_value(sdi, "HCJR", v, SR_MQ_POWER, SR_UNIT_WATT_HOUR);
-       } else if (!strcmp(label, "IINST")) {
+       else if (!strcmp(label, "IINST"))
                teleinfo_send_value(sdi, "IINST", v, SR_MQ_CURRENT, SR_UNIT_AMPERE);
-       } else if (!strcmp(label, "PAPP")) {
+       else if (!strcmp(label, "PAPP"))
                teleinfo_send_value(sdi, "PAPP", v, SR_MQ_POWER, SR_UNIT_VOLT_AMPERE);
-       }
 }
 
 static gboolean teleinfo_parse_group(struct sr_dev_inst *sdi,