util/nvmutil: Remove unnecessary buffer

The buf variable is only used once, and only so
that we can get a pointer. We can point to buf16
instead, for the same result.

The gbe pointer (size_t) is later converter to
a char * when writing back to the file.

Signed-off-by: Leah Rowe <leah@libreboot.org>
master
Leah Rowe 2025-01-25 06:23:22 +00:00
parent 252e2bdb71
commit 6c2a8010e2
1 changed files with 1 additions and 2 deletions

View File

@ -32,7 +32,6 @@ uint8_t hextonum(char chs), rhex(void);
#define SIZE_128KB 0x20000
uint16_t buf16[SIZE_64KB], mac[3] = {0, 0, 0};
uint8_t *buf = (uint8_t *) &buf16;
size_t partsize, nf, gbe[2];
uint8_t nvmPartChanged[2] = {0, 0}, skipread[2] = {0, 0};
int e = 1, flags, rfd, fd, part, gbeFileChanged = 0;
@ -208,7 +207,7 @@ readGbe(void)
skipread[part ^ 1] = 1; /* only read the user-specified part */
/* we pread per-part, so each part has its own pointer: */
gbe[0] = (size_t) buf;
gbe[0] = (size_t) buf16;
gbe[1] = gbe[0] + partsize;
for (int p = 0; p < 2; p++) {