diff options
author | Angel Pons <th3fanbus@gmail.com> | 2021-06-07 13:29:13 +0200 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2021-06-09 16:07:45 +0000 |
commit | f41d24823c1703e328fc27588bbcf3c96eecdbc9 (patch) | |
tree | 3bd19f60db955c7206fa72a1ccdb7a2607e7001d /raiden_debug_spi.c | |
parent | 3bd47524c044168b01e54e772d23c7fa723dc0d5 (diff) | |
download | flashrom-f41d24823c1703e328fc27588bbcf3c96eecdbc9.tar.gz flashrom-f41d24823c1703e328fc27588bbcf3c96eecdbc9.tar.bz2 flashrom-f41d24823c1703e328fc27588bbcf3c96eecdbc9.zip |
treewide: Drop unnecessary uses of memset/memcpy
Simply provide an initialiser or use a direct assignment instead.
Change-Id: I07385375cd8eec8a95874001b402b2c17ec09e09
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/55267
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'raiden_debug_spi.c')
-rw-r--r-- | raiden_debug_spi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/raiden_debug_spi.c b/raiden_debug_spi.c index 950b8afb..4e177e54 100644 --- a/raiden_debug_spi.c +++ b/raiden_debug_spi.c @@ -1510,12 +1510,10 @@ int raiden_debug_spi_init(void) found = 1; goto loop_end; } else { - unsigned char dev_serial[32]; + unsigned char dev_serial[32] = { 0 }; struct libusb_device_descriptor descriptor; int rc; - memset(dev_serial, 0, sizeof(dev_serial)); - if (libusb_get_device_descriptor(device->device, &descriptor)) { msg_pdbg("USB: Failed to get device descriptor.\n"); goto loop_end; @@ -1591,7 +1589,7 @@ loop_end: return SPI_GENERIC_ERROR; } - memcpy(spi_config, &spi_master_raiden_debug, sizeof(*spi_config)); + *spi_config = spi_master_raiden_debug; data->dev = device; data->in_ep = in_endpoint; |