]> sigrok.org Git - libsigrok.git/commitdiff
dreamsourcelab-dslogic: Moved devc and usb assignment into initializers
authorJoel Holdsworth <redacted>
Mon, 18 Sep 2017 01:51:15 +0000 (19:51 -0600)
committerUwe Hermann <redacted>
Mon, 18 Sep 2017 22:31:11 +0000 (00:31 +0200)
src/hardware/dreamsourcelab-dslogic/protocol.c

index c665d071ce691524742715f3f62d13e7b4c7bcf0..2bf3366824434f09394c34f4e5976d5c6092ea75 100644 (file)
@@ -423,8 +423,8 @@ static void set_trigger(const struct sr_dev_inst *sdi, struct fpga_config *cfg)
 
 static int fpga_configure(const struct sr_dev_inst *sdi)
 {
-       struct dev_context *devc;
-       struct sr_usb_dev_inst *usb;
+       const struct dev_context *const devc = sdi->priv;
+       const struct sr_usb_dev_inst *const usb = sdi->conn;
        uint8_t c[3];
        struct fpga_config cfg;
        uint16_t mode = 0;
@@ -433,9 +433,6 @@ static int fpga_configure(const struct sr_dev_inst *sdi)
 
        sr_dbg("Configuring FPGA.");
 
-       usb = sdi->conn;
-       devc = sdi->priv;
-
        WL32(&cfg.sync, DS_CFG_START);
        WL16(&cfg.mode_header, DS_CFG_MODE);
        WL16(&cfg.divider_header, DS_CFG_DIVIDER);