1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 14:33:18 +02:00

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>
This commit is contained in:
Angel Pons
2021-06-07 13:29:13 +02:00
committed by Nico Huber
parent 3bd47524c0
commit f41d24823c
8 changed files with 21 additions and 49 deletions

View File

@ -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);