From: Matthias Heidbrink Date: Mon, 19 May 2014 18:47:15 +0000 (+0200) Subject: motech-lps-30x: Cleanup. X-Git-Tag: libsigrok-0.4.0~1314 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1f7da0c2bbc096cdc5750f47e084ced8c7ce6e48;p=libsigrok.git motech-lps-30x: Cleanup. --- diff --git a/hardware/motech-lps-30x/api.c b/hardware/motech-lps-30x/api.c index d4b6c0d7..bc10702a 100644 --- a/hardware/motech-lps-30x/api.c +++ b/hardware/motech-lps-30x/api.c @@ -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) diff --git a/hardware/motech-lps-30x/protocol.c b/hardware/motech-lps-30x/protocol.c index 5cffdcce..11c1be6d 100644 --- a/hardware/motech-lps-30x/protocol.c +++ b/hardware/motech-lps-30x/protocol.c @@ -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';