summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-09-18 16:36:45 +0100
committerLeah Rowe <leah@libreboot.org>2023-09-18 16:36:45 +0100
commit9a92524a47fa9d1c5102ead99250a86b1a635866 (patch)
tree9c166fa811dda87ce34773d132c840661dd1c71b /util/nvmutil
parent5a129cea1158d9e4d895f68b37b8394c3af3a44a (diff)
util/nvmutil: remove SIZE_8KB define
use SIZE_4KB << 1 when needing 8KB size Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 7be2b08..0d0471a 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -36,7 +36,6 @@ void writeGbeFile(void);
#define MAC_ADDRESS argv[3]
#define PARTNUM argv[3]
#define SIZE_4KB 0x1000
-#define SIZE_8KB 0x2000
uint16_t buf16[SIZE_4KB], mac[3] = {0, 0, 0};
uint8_t *buf = (uint8_t *) &buf16;
@@ -113,7 +112,7 @@ openFiles(const char *path)
{
struct stat st;
xopen(fd, path, flags);
- if ((st.st_size != SIZE_8KB))
+ if ((st.st_size != (SIZE_4KB << 1)))
err(errno = ECANCELED, "File `%s` not 8KiB", path);
xopen(rfd, "/dev/urandom", O_RDONLY);
errno = errno != ENOTDIR ? errno : 0;