aboutsummaryrefslogtreecommitdiffstats
path: root/linux_mtd.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 /linux_mtd.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 'linux_mtd.c')
-rw-r--r--linux_mtd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/linux_mtd.c b/linux_mtd.c
index a1af0696..b0681641 100644
--- a/linux_mtd.c
+++ b/linux_mtd.c
@@ -315,8 +315,7 @@ static int linux_mtd_setup(int dev_num, struct linux_mtd_data *data)
if (snprintf(sysfs_path, sizeof(sysfs_path), "%s/mtd%d/", LINUX_MTD_SYSFS_ROOT, dev_num) < 0)
goto linux_mtd_setup_exit;
- char buf[4];
- memset(buf, 0, sizeof(buf));
+ char buf[4] = { 0 };
if (read_sysfs_string(sysfs_path, "type", buf, sizeof(buf)))
return 1;