From 2b01e023abff6a75b5033978200ce156ac9c643a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 3 Mar 2026 00:40:07 +0000 Subject: util/nvmutil: remove do_read pointless code complication, that doesn't yield a noticeable performance increase. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'util/nvmutil/nvmutil.c') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 1f592af0..c9b29051 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -42,7 +42,7 @@ uint8_t buf[SIZE_8KB]; uint16_t mac[3] = {0, 0, 0}; size_t partsize; uint8_t *gbe[2]; -uint8_t nvmPartChanged[2] = {0, 0}, do_read[2] = {1, 1}; +uint8_t nvmPartChanged[2] = {0, 0}; int flags, rfd, fd, part, e = 1; const char *strMac = NULL, *strRMac = "xx:xx:xx:xx:xx:xx", *fname = NULL; @@ -188,10 +188,6 @@ xopen(int *f, const char *l, int p, struct stat *st) void nvmalloc(void) { - /* only read the part specified, for copy/setchecksum/brick */ - if ((cmd == cmd_copy) || (cmd == cmd_setchecksum) || (cmd == cmd_brick)) - do_read[part ^ 1] = 0; - gbe[0] = buf; gbe[1] = buf + SIZE_4KB; } @@ -200,8 +196,7 @@ void readGbe(void) { for (int p = 0; p < 2; p++) - if (do_read[p]) - readGbe_part(p); + readGbe_part(p); } void -- cgit v1.2.1