]> sigrok.org Git - libsigrok.git/commitdiff
fx2lafw/dslogic: Use const buffer instead of memset
authorJoel Holdsworth <redacted>
Thu, 8 Jun 2017 22:49:18 +0000 (16:49 -0600)
committerUwe Hermann <redacted>
Mon, 19 Jun 2017 22:18:16 +0000 (00:18 +0200)
src/hardware/fx2lafw/dslogic.c

index 9c74ff1af77539acec209d49a345963203f11aca..334ac57b52b988310e3ab62d582c2807ac64c294 100644 (file)
@@ -70,7 +70,7 @@ SR_PRIV int dslogic_fpga_firmware_upload(const struct sr_dev_inst *sdi,
        ssize_t chunksize;
        int transferred;
        int result, ret;
-       uint8_t cmd[3];
+       const uint8_t cmd[3] = {0, 0, 0};
 
        drvc = sdi->driver->context;
        usb = sdi->conn;
@@ -83,7 +83,6 @@ SR_PRIV int dslogic_fpga_firmware_upload(const struct sr_dev_inst *sdi,
                return result;
 
        /* Tell the device firmware is coming. */
-       memset(cmd, 0, sizeof(cmd));
        if ((ret = libusb_control_transfer(usb->devhdl, LIBUSB_REQUEST_TYPE_VENDOR |
                        LIBUSB_ENDPOINT_OUT, DS_CMD_CONFIG, 0x0000, 0x0000,
                        (unsigned char *)&cmd, sizeof(cmd), USB_TIMEOUT)) < 0) {