Reduce unnecessarily high indentation level in some places.

This commit is contained in:
Uwe Hermann 2015-03-28 19:36:47 +01:00
parent 2ea67fc9bf
commit dc89faeace
4 changed files with 274 additions and 269 deletions

View File

@ -660,7 +660,9 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
if (!(devc = sdi->priv))
return TRUE;
if (revents == G_IO_IN) {
if (revents != G_IO_IN)
return TRUE;
ch = devc->current_channel->data;
switch (ch->type) {
@ -723,7 +725,6 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
devc->current_channel = devc->enabled_channels;
hmo_request_data(sdi);
}
}
return TRUE;
}

View File

@ -188,8 +188,10 @@ SR_PRIV int motech_lps_30x_receive_data(int fd, int revents, void *cb_data)
sdi->driver->dev_acquisition_stop(sdi, cb_data);
}
/* Request next packet, if required. */
if ((sdi->status == SR_ST_ACTIVE) && (devc->acq_running)){
/* Only request the next packet if required. */
if (!((sdi->status == SR_ST_ACTIVE) && (devc->acq_running)))
return TRUE;
if (devc->acq_req_pending) {
gint64 elapsed_us = g_get_monotonic_time() - devc->req_sent_at;
if (elapsed_us > (REQ_TIMEOUT_MS * 1000)) {
@ -197,6 +199,7 @@ SR_PRIV int motech_lps_30x_receive_data(int fd, int revents, void *cb_data)
devc->acq_req_pending = 0;
}
}
if (devc->acq_req_pending == 0) {
switch (devc->acq_req) {
case AQ_NONE: /* Fall through */
@ -232,7 +235,6 @@ SR_PRIV int motech_lps_30x_receive_data(int fd, int revents, void *cb_data)
devc->req_sent_at = g_get_real_time();
devc->acq_req_pending = 1;
}
}
return TRUE;
}

View File

@ -619,8 +619,9 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data)
}
return TRUE;
} else {
do bytes_read = ftdi_read_data(devc->ftdic, devc->ftdi_buf, FTDI_BUF_SIZE);
while (bytes_read > 0);
do {
bytes_read = ftdi_read_data(devc->ftdic, devc->ftdi_buf, FTDI_BUF_SIZE);
} while (bytes_read > 0);
/*
* We've acquired all the samples we asked for -- we're done.

View File

@ -554,7 +554,9 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
scpi = sdi->conn;
if (revents == G_IO_IN || revents == 0) {
if (!(revents == G_IO_IN || revents == 0))
return TRUE;
switch (devc->wait_event) {
case WAIT_NONE:
break;
@ -753,7 +755,6 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
sr_session_send(cb_data, &packet);
}
}
}
return TRUE;
}