From: Uwe Hermann Date: Sat, 23 Apr 2016 18:58:46 +0000 (+0200) Subject: dev_open(): Don't check for sdi != NULL. X-Git-Tag: libsigrok-0.5.0~473 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=61c908589828b11352b5d792c4278964e1220a59;p=libsigrok.git dev_open(): Don't check for sdi != NULL. The wrapper guarantees that sdi is not NULL. --- diff --git a/src/hardware/chronovu-la/api.c b/src/hardware/chronovu-la/api.c index d8de0da1..040a9c4b 100644 --- a/src/hardware/chronovu-la/api.c +++ b/src/hardware/chronovu-la/api.c @@ -255,8 +255,7 @@ static int dev_open(struct sr_dev_inst *sdi) struct dev_context *devc; int ret; - if (!(devc = sdi->priv)) - return SR_ERR_BUG; + devc = sdi->priv; /* Allocate memory for the FTDI context and initialize it. */ if (!(devc->ftdic = ftdi_new())) { diff --git a/src/hardware/hp-3457a/api.c b/src/hardware/hp-3457a/api.c index 05a45e62..b152be92 100644 --- a/src/hardware/hp-3457a/api.c +++ b/src/hardware/hp-3457a/api.c @@ -213,7 +213,7 @@ static int dev_open(struct sr_dev_inst *sdi) if (sr_scpi_open(scpi) != SR_OK) return SR_ERR; - devc=sdi->priv; + devc = sdi->priv; sr_scpi_send(scpi, "PRESET"); sr_scpi_send(scpi, "INBUF ON"); diff --git a/src/hardware/zeroplus-logic-cube/api.c b/src/hardware/zeroplus-logic-cube/api.c index c85a4089..22e949c9 100644 --- a/src/hardware/zeroplus-logic-cube/api.c +++ b/src/hardware/zeroplus-logic-cube/api.c @@ -273,11 +273,7 @@ static int dev_open(struct sr_dev_inst *sdi) drvc = di->context; usb = sdi->conn; - - if (!(devc = sdi->priv)) { - sr_err("%s: sdi->priv was NULL", __func__); - return SR_ERR_ARG; - } + devc = sdi->priv; device_count = libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist);