From: Uwe Hermann Date: Sat, 23 Apr 2016 18:59:38 +0000 (+0200) Subject: Drop some unused or duplicated code. X-Git-Tag: libsigrok-0.5.0~474 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c50805d59ce85e00ef263c0a1edad2487bb8a9fe;p=libsigrok.git Drop some unused or duplicated code. --- diff --git a/src/hardware/gmc-mh-1x-2x/api.c b/src/hardware/gmc-mh-1x-2x/api.c index 15bf7f9f..28927fc5 100644 --- a/src/hardware/gmc-mh-1x-2x/api.c +++ b/src/hardware/gmc-mh-1x-2x/api.c @@ -291,7 +291,6 @@ static GSList *scan_2x_bd232(struct sr_dev_driver *di, GSList *options) /* Send message 03 "Query multimeter version and status" */ sdi->conn = serial; - sdi->priv = devc; if (req_stat14(sdi, TRUE) != SR_OK) goto exit_err; diff --git a/src/hardware/motech-lps-30x/api.c b/src/hardware/motech-lps-30x/api.c index cee97b57..7f9c33f6 100644 --- a/src/hardware/motech-lps-30x/api.c +++ b/src/hardware/motech-lps-30x/api.c @@ -242,7 +242,7 @@ SR_PRIV int lps_process_status(struct sr_dev_inst *sdi, int stat) struct dev_context *devc; int tracking_mode; - devc = (struct dev_context *)sdi->priv; + devc = sdi->priv; sr_spew("Status: %d", stat); devc->channel_status[0].cc_mode = (stat & 0x01) != 0; @@ -289,7 +289,7 @@ SR_PRIV int lps_query_status(struct sr_dev_inst *sdi) int stat, ret; struct dev_context *devc; - devc = (struct dev_context *)sdi->priv; + devc = sdi->priv; devc->req_sent_at = g_get_real_time(); diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index 112bedc0..10ab5f9e 100644 --- a/src/hardware/scpi-pps/api.c +++ b/src/hardware/scpi-pps/api.c @@ -203,7 +203,6 @@ static int dev_open(struct sr_dev_inst *sdi) devc = sdi->priv; scpi_cmd(sdi, devc->device->commands, SCPI_CMD_REMOTE); - devc = sdi->priv; devc->beeper_was_set = FALSE; if (scpi_cmd_resp(sdi, devc->device->commands, &beeper, G_VARIANT_TYPE_BOOLEAN, SCPI_CMD_BEEPER) == SR_OK) { diff --git a/src/hardware/zeroplus-logic-cube/api.c b/src/hardware/zeroplus-logic-cube/api.c index 22ec33b5..c85a4089 100644 --- a/src/hardware/zeroplus-logic-cube/api.c +++ b/src/hardware/zeroplus-logic-cube/api.c @@ -694,16 +694,10 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) /* TODO: This stops acquisition on ALL devices, ignoring dev_index. */ static int dev_acquisition_stop(struct sr_dev_inst *sdi) { - struct dev_context *devc; struct sr_usb_dev_inst *usb; std_session_send_df_end(sdi, LOG_PREFIX); - if (!(devc = sdi->priv)) { - sr_err("%s: sdi->priv was NULL", __func__); - return SR_ERR_BUG; - } - usb = sdi->conn; analyzer_reset(usb->devhdl); /* TODO: Need to cancel and free any queued up transfers. */