From cd189a44f87c246fa03d3d6e57cc4b4722c07715 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Thu, 8 Jun 2017 16:49:18 -0600 Subject: [PATCH] fx2lafw/dslogic: Use const buffer instead of memset --- src/hardware/fx2lafw/dslogic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hardware/fx2lafw/dslogic.c b/src/hardware/fx2lafw/dslogic.c index 9c74ff1a..334ac57b 100644 --- a/src/hardware/fx2lafw/dslogic.c +++ b/src/hardware/fx2lafw/dslogic.c @@ -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) {