summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-02-19 12:23:01 +0000
committerLeah Rowe <leah@libreboot.org>2026-02-19 12:23:57 +0000
commit5a8ad2d311d7f02826110bba5a3e88ca6273620a (patch)
treecf487c91a1151931dc47b305d8d94b30211c96f8 /util
parenta95cf1feeb270c2c1c06bc62b19f548da78a1f92 (diff)
util/nvmutil: general code cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 05459bb7..b1469586 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: MIT */
-/* Copyright (c) 2022-2025 Leah Rowe <leah@libreboot.org> */
+/* Copyright (c) 2022-2026 Leah Rowe <leah@libreboot.org> */
/* Copyright (c) 2023 Riku Viitanen <riku.viitanen@protonmail.com> */
#include <sys/stat.h>
@@ -38,7 +38,7 @@ uint16_t mac[3] = {0, 0, 0};
ssize_t nf;
size_t partsize, gbe[2];
uint8_t nvmPartChanged[2] = {0, 0}, do_read[2] = {1, 1};
-int flags, rfd, fd, part;
+int flags, rfd, fd, part, e = 1;
const char *strMac = NULL, *strRMac = "xx:xx:xx:xx:xx:xx", *filename = NULL;
@@ -459,12 +459,10 @@ writeGbe(void)
void
swap(int partnum)
{
- size_t w, x;
uint8_t *n = (uint8_t *) gbe[partnum];
- int e = 1;
- for (w = NVM_SIZE * ((uint8_t *) &e)[0], x = 1; w < NVM_SIZE;
- w += 2, x += 2) {
+ for (size_t w = NVM_SIZE * ((uint8_t *) &e)[0], x = 1;
+ w < NVM_SIZE; w += 2, x += 2) {
n[w] ^= n[x];
n[x] ^= n[w];
n[w] ^= n[x];