]> sigrok.org Git - libsigrok.git/commitdiff
motech-lps-30x: Cleanup.
authorMatthias Heidbrink <redacted>
Mon, 19 May 2014 18:47:15 +0000 (20:47 +0200)
committerMatthias Heidbrink <redacted>
Mon, 19 May 2014 18:47:15 +0000 (20:47 +0200)
hardware/motech-lps-30x/api.c
hardware/motech-lps-30x/protocol.c

index d4b6c0d7ec696bb4e9913c1056d3742d6823f0cd..bc10702adf4660cecea401fc601d2052e1bd921c 100644 (file)
@@ -281,7 +281,6 @@ SR_PRIV int lps_query_status(struct sr_dev_inst* sdi)
 {
        char buf[LINELEN_MAX];
        int stat;
-       const char* ptr;
        struct dev_context* devc;
 
        devc = (struct dev_context*)sdi->priv;
@@ -293,11 +292,7 @@ SR_PRIV int lps_query_status(struct sr_dev_inst* sdi)
                return SR_ERR;
        }
 
-       /* Jump across leading zeros to prevent sr_atoi() believing this to be octal. */
-       for (ptr = buf; isspace(*buf) || (*ptr == '0'); ptr++)
-               ;
-
-       if (sr_atoi(ptr, &stat) != SR_OK)
+       if (sr_atoi(buf, &stat) != SR_OK)
                return SR_ERR;
 
        return lps_process_status(sdi, stat);
@@ -369,7 +364,7 @@ SR_PRIV int lps_read_reply(struct sr_serial_dev_inst *serial, char **buf, int *b
 
 /** Scan for LPS-300 series device.
  */
-static GSList *doScan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *options)
+static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *options)
 {
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
@@ -511,7 +506,7 @@ exit_err:
 /** Scan for LPS-301 device. */
 static GSList *scan_lps301(GSList *options)
 {
-       return doScan(LPS_301, &motech_lps_301_driver_info, options);
+       return do_scan(LPS_301, &motech_lps_301_driver_info, options);
 }
 
 static GSList *doDevList(struct sr_dev_driver *drv)
index 5cffdcce3233b2934cc6f96d5f561cbc3b36223e..11c1be6d3fca7a39b9fd7c3572b9d7172444582b 100644 (file)
@@ -139,7 +139,6 @@ SR_PRIV int motech_lps_30x_receive_data(int fd, int revents, void *cb_data)
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
        struct sr_serial_dev_inst *serial;
-       // char achar;
        int len;
        gdouble elapsed_s;
 
@@ -166,9 +165,6 @@ SR_PRIV int motech_lps_30x_receive_data(int fd, int revents, void *cb_data)
                                continue;
                        }
 
-                       // achar = *(devc->buf + devc->buflen);
-                       // sr_spew("read 0x%02x/%d/'%c'", achar, achar, achar);
-
                        devc->buflen += len;
                        devc->buf[devc->buflen] = '\0';