aboutsummaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-06-07 13:29:13 +0200
committerNico Huber <nico.h@gmx.de>2021-06-09 16:07:45 +0000
commitf41d24823c1703e328fc27588bbcf3c96eecdbc9 (patch)
tree3bd19f60db955c7206fa72a1ccdb7a2607e7001d /flashrom.c
parent3bd47524c044168b01e54e772d23c7fa723dc0d5 (diff)
downloadflashrom-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 'flashrom.c')
-rw-r--r--flashrom.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/flashrom.c b/flashrom.c
index cd2e9a7e..b804e2d4 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -761,7 +761,7 @@ int probe_flash(struct registered_master *mst, int startchip, struct flashctx *f
msg_gerr("Out of memory!\n");
exit(1);
}
- memcpy(flash->chip, chip, sizeof(*flash->chip));
+ *flash->chip = *chip;
flash->mst = mst;
if (map_flash(flash) != 0)
@@ -1619,11 +1619,9 @@ void list_programmers_linebreak(int startcol, int cols, int paren)
static void print_sysinfo(void)
{
#if IS_WINDOWS
- SYSTEM_INFO si;
- OSVERSIONINFOEX osvi;
+ SYSTEM_INFO si = { 0 };
+ OSVERSIONINFOEX osvi = { 0 };
- memset(&si, 0, sizeof(SYSTEM_INFO));
- memset(&osvi, 0, sizeof(OSVERSIONINFOEX));
msg_ginfo(" on Windows");
/* Tell Windows which version of the structure we want. */
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);