drivers: Random whitespace fixes.

This commit is contained in:
Uwe Hermann 2017-08-06 16:42:35 +02:00
parent db85496ed1
commit 8ebad34370
6 changed files with 34 additions and 47 deletions

View 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

View 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++;
}

View 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;
}
}

View 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;

View 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;
}
}

View 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,