]> sigrok.org Git - libsigrok.git/commitdiff
rdtech-tc: eliminate excessive indentation, address whitespace issues
authorGerhard Sittig <redacted>
Thu, 16 Mar 2023 01:28:51 +0000 (02:28 +0100)
committerGerhard Sittig <redacted>
Thu, 16 Mar 2023 13:29:30 +0000 (14:29 +0100)
[ see a whitespace ignoring diff for review ]

src/hardware/rdtech-tc/api.c
src/hardware/rdtech-tc/protocol.c
src/hardware/rdtech-tc/protocol.h

index e02a38c0f53afef524aa51b2dbcceb924b87634e..962e8f24a1575666a8592779bf2c2722e681624f 100644 (file)
@@ -46,8 +46,8 @@ static const uint32_t devopts[] = {
        SR_CONF_LIMIT_MSEC | SR_CONF_SET,
 };
 
-static GSList *rdtech_tc_scan(struct sr_dev_driver *di, const char *conn,
-                             const char *serialcomm)
+static GSList *rdtech_tc_scan(struct sr_dev_driver *di,
+       const char *conn, const char *serialcomm)
 {
        struct sr_serial_dev_inst *serial;
        GSList *devices = NULL;
@@ -119,7 +119,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 }
 
 static int config_set(uint32_t key, GVariant *data,
-                     const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
 
@@ -131,7 +131,7 @@ static int config_set(uint32_t key, GVariant *data,
 }
 
 static int config_list(uint32_t key, GVariant **data,
-                      const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
 }
@@ -145,7 +145,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        std_session_send_df_header(sdi);
 
        serial_source_add(sdi->session, serial, G_IO_IN, 50,
-                         rdtech_tc_receive_data, (void *)sdi);
+               rdtech_tc_receive_data, (void *)sdi);
 
        return rdtech_tc_poll(sdi);
 }
index 93e479819a15aea4dc36c6023283be6572138688..46d0e83e0510d301071707e4ce8c1e539436d076 100644 (file)
@@ -93,7 +93,7 @@ static int check_pac_crc(uint8_t *data)
        }
 }
 
-static int process_poll_pkt(struct dev_context  *devc, uint8_t *dst)
+static int process_poll_pkt(struct dev_context *devc, uint8_t *dst)
 {
        struct aes256_ctx ctx;
 
@@ -117,13 +117,13 @@ static int process_poll_pkt(struct dev_context  *devc, uint8_t *dst)
        return SR_OK;
 }
 
-SR_PRIV int rdtech_tc_probe(struct sr_serial_dev_inst *serial, struct dev_context  *devc)
+SR_PRIV int rdtech_tc_probe(struct sr_serial_dev_inst *serial, struct dev_context *devc)
 {
        int len;
        uint8_t poll_pkt[TC_POLL_LEN];
 
        if (serial_write_blocking(serial, &POLL_CMD, sizeof(POLL_CMD) - 1,
-                                  SERIAL_WRITE_TIMEOUT_MS) < 0) {
+                       SERIAL_WRITE_TIMEOUT_MS) < 0) {
                sr_err("Unable to send probe request.");
                return SR_ERR;
        }
@@ -153,7 +153,7 @@ SR_PRIV int rdtech_tc_poll(const struct sr_dev_inst *sdi)
        struct sr_serial_dev_inst *serial = sdi->conn;
 
        if (serial_write_blocking(serial, &POLL_CMD, sizeof(POLL_CMD) - 1,
-                                  SERIAL_WRITE_TIMEOUT_MS) < 0) {
+                       SERIAL_WRITE_TIMEOUT_MS) < 0) {
                sr_err("Unable to send poll request.");
                return SR_ERR;
        }
@@ -183,8 +183,8 @@ static void handle_poll_data(const struct sr_dev_inst *sdi)
 
        for (ch = sdi->channels, i = 0; ch; ch = g_slist_next(ch), i++) {
                bv_send_analog_channel(sdi, ch->data,
-                                      &devc->channels[i], poll_pkt, TC_POLL_LEN);
-        }
+                       &devc->channels[i], poll_pkt, TC_POLL_LEN);
+       }
 
        sr_sw_limits_update_samples_read(&devc->limits, 1);
 }
index 963c7765623bf654514a7c273660b5022da341f4..9c7056d0bfe97b1d21ba4acc80994be6b5d0db76 100644 (file)
@@ -37,13 +37,12 @@ struct dev_context {
        struct rdtech_dev_info dev_info;
        const struct binary_analog_channel *channels;
        struct sr_sw_limits limits;
-
        uint8_t buf[RDTECH_TC_BUFSIZE];
        int buflen;
        int64_t cmd_sent_at;
 };
 
-SR_PRIV int rdtech_tc_probe(struct sr_serial_dev_inst *serial, struct dev_context  *devc);
+SR_PRIV int rdtech_tc_probe(struct sr_serial_dev_inst *serial, struct dev_context *devc);
 SR_PRIV int rdtech_tc_receive_data(int fd, int revents, void *cb_data);
 SR_PRIV int rdtech_tc_poll(const struct sr_dev_inst *sdi);